Search in sources :

Example 1 with AggregatedTabMapping

use of org.apereo.portal.events.aggr.tabs.AggregatedTabMapping in project uPortal by Jasig.

the class JpaTabRenderAggregationDaoTest method createAggregations.

@Override
protected Map<TabRenderAggregationKey, TabRenderAggregationImpl> createAggregations(AggregationIntervalInfo intervalInfo, AggregatedGroupMapping aggregatedGroup) {
    final DateDimension dateDimension = intervalInfo.getDateDimension();
    final TimeDimension timeDimension = intervalInfo.getTimeDimension();
    final AggregationInterval aggregationInterval = intervalInfo.getAggregationInterval();
    final AggregatedTabMapping mappedTab = this.aggregatedTabLookupDao.getMappedTabForLayoutId("u1l1n1");
    final TabRenderAggregationKeyImpl key = new TabRenderAggregationKeyImpl(dateDimension, timeDimension, aggregationInterval, aggregatedGroup, mappedTab);
    final TabRenderAggregationImpl aggr = renderAggregationDao.createAggregation(key);
    return Collections.<TabRenderAggregationKey, TabRenderAggregationImpl>singletonMap(key, aggr);
}
Also used : TimeDimension(org.apereo.portal.events.aggr.TimeDimension) DateDimension(org.apereo.portal.events.aggr.DateDimension) AggregationInterval(org.apereo.portal.events.aggr.AggregationInterval) AggregatedTabMapping(org.apereo.portal.events.aggr.tabs.AggregatedTabMapping)

Example 2 with AggregatedTabMapping

use of org.apereo.portal.events.aggr.tabs.AggregatedTabMapping in project uPortal by Jasig.

the class TabRenderStatisticsController method createColumnDiscriminatorMap.

protected Map<TabRenderAggregationDiscriminator, SortedSet<TabRenderAggregation>> createColumnDiscriminatorMap(TabRenderReportForm form) {
    //Collections used to track the queried groups and the results
    final Map<TabRenderAggregationDiscriminator, SortedSet<TabRenderAggregation>> groupedAggregations = new TreeMap<TabRenderAggregationDiscriminator, SortedSet<TabRenderAggregation>>(TabRenderAggregationDiscriminatorImpl.Comparator.INSTANCE);
    //Get concrete group mapping objects that are being queried for
    List<Long> groups = form.getGroups();
    List<Long> tabs = form.getTabs();
    for (final Long queryGroupId : groups) {
        AggregatedGroupMapping groupMapping = this.aggregatedGroupDao.getGroupMapping(queryGroupId);
        for (final Long tabId : tabs) {
            AggregatedTabMapping tabMapping = this.aggregatedTabLookupDao.getTabMapping(tabId);
            final TabRenderAggregationDiscriminator mapping = new TabRenderAggregationDiscriminatorImpl(groupMapping, tabMapping);
            //Create the set the aggregations for this report column will be stored in, sorted chronologically
            final SortedSet<TabRenderAggregation> aggregations = new TreeSet<TabRenderAggregation>(BaseAggregationDateTimeComparator.INSTANCE);
            //Map the group to the set
            groupedAggregations.put(mapping, aggregations);
        }
    }
    return groupedAggregations;
}
Also used : TabRenderAggregationDiscriminatorImpl(org.apereo.portal.events.aggr.tabrender.TabRenderAggregationDiscriminatorImpl) AggregatedGroupMapping(org.apereo.portal.events.aggr.groups.AggregatedGroupMapping) TabRenderAggregationDiscriminator(org.apereo.portal.events.aggr.tabrender.TabRenderAggregationDiscriminator) TabRenderAggregation(org.apereo.portal.events.aggr.tabrender.TabRenderAggregation) TreeSet(java.util.TreeSet) TreeMap(java.util.TreeMap) SortedSet(java.util.SortedSet) AggregatedTabMapping(org.apereo.portal.events.aggr.tabs.AggregatedTabMapping)

Example 3 with AggregatedTabMapping

use of org.apereo.portal.events.aggr.tabs.AggregatedTabMapping in project uPortal by Jasig.

the class JpaTabRenderAggregationDao method createAggregationInstance.

@Override
protected TabRenderAggregationImpl createAggregationInstance(TabRenderAggregationKey key) {
    final TimeDimension timeDimension = key.getTimeDimension();
    final DateDimension dateDimension = key.getDateDimension();
    final AggregationInterval interval = key.getInterval();
    final AggregatedGroupMapping aggregatedGroup = key.getAggregatedGroup();
    final AggregatedTabMapping tabMapping = key.getTabMapping();
    return new TabRenderAggregationImpl(timeDimension, dateDimension, interval, aggregatedGroup, tabMapping);
}
Also used : AggregatedGroupMapping(org.apereo.portal.events.aggr.groups.AggregatedGroupMapping) TimeDimension(org.apereo.portal.events.aggr.TimeDimension) DateDimension(org.apereo.portal.events.aggr.DateDimension) AggregationInterval(org.apereo.portal.events.aggr.AggregationInterval) AggregatedTabMapping(org.apereo.portal.events.aggr.tabs.AggregatedTabMapping)

Example 4 with AggregatedTabMapping

use of org.apereo.portal.events.aggr.tabs.AggregatedTabMapping in project uPortal by Jasig.

the class TabRenderAggregator method createAggregationKey.

@Override
protected TabRenderAggregationKey createAggregationKey(PortalRenderEvent e, EventAggregationContext eventAggregationContext, AggregationIntervalInfo intervalInfo, AggregatedGroupMapping aggregatedGroup) {
    final TimeDimension timeDimension = intervalInfo.getTimeDimension();
    final DateDimension dateDimension = intervalInfo.getDateDimension();
    final AggregationInterval aggregationInterval = intervalInfo.getAggregationInterval();
    Map<String, AggregatedTabMapping> mappedTabs = eventAggregationContext.getAttribute(MAPPED_TABS_CACHE_KEY);
    if (mappedTabs == null) {
        mappedTabs = new HashMap<String, AggregatedTabMapping>();
        eventAggregationContext.setAttribute(MAPPED_TABS_CACHE_KEY, mappedTabs);
    }
    final String targetedLayoutNodeId = e.getTargetedLayoutNodeId();
    AggregatedTabMapping mappedTab = mappedTabs.get(targetedLayoutNodeId);
    if (mappedTab == null) {
        mappedTab = this.aggregatedTabLookupDao.getMappedTabForLayoutId(targetedLayoutNodeId);
        mappedTabs.put(targetedLayoutNodeId, mappedTab);
    }
    return new TabRenderAggregationKeyImpl(dateDimension, timeDimension, aggregationInterval, aggregatedGroup, mappedTab);
}
Also used : TimeDimension(org.apereo.portal.events.aggr.TimeDimension) DateDimension(org.apereo.portal.events.aggr.DateDimension) AggregationInterval(org.apereo.portal.events.aggr.AggregationInterval) AggregatedTabMapping(org.apereo.portal.events.aggr.tabs.AggregatedTabMapping)

Example 5 with AggregatedTabMapping

use of org.apereo.portal.events.aggr.tabs.AggregatedTabMapping in project uPortal by Jasig.

the class AnalyticsIncorporationComponent method serializePageData.

protected String serializePageData(HttpServletRequest request, long startTime) {
    final Map<String, Object> pageData = new HashMap<String, Object>();
    pageData.put("executionTimeNano", System.nanoTime() - startTime);
    final IPortalRequestInfo portalRequestInfo = urlSyntaxProvider.getPortalRequestInfo(request);
    pageData.put("urlState", portalRequestInfo.getUrlState());
    final String targetedLayoutNodeId = portalRequestInfo.getTargetedLayoutNodeId();
    if (targetedLayoutNodeId != null) {
        final AggregatedTabMapping mappedTabForLayoutId = aggregatedTabLookupDao.getMappedTabForLayoutId(targetedLayoutNodeId);
        pageData.put("tab", mappedTabForLayoutId);
    }
    try {
        return mapper.writeValueAsString(pageData);
    } catch (JsonParseException e) {
        logger.warn("Failed to convert this request's page data to JSON, no page level analytics will be included", e);
    } catch (JsonMappingException e) {
        logger.warn("Failed to convert this request's page data to JSON, no page level analytics will be included", e);
    } catch (IOException e) {
        logger.warn("Failed to convert this request's page data to JSON, no page level analytics will be included", e);
    }
    return "{}";
}
Also used : IPortalRequestInfo(org.apereo.portal.url.IPortalRequestInfo) HashMap(java.util.HashMap) JsonMappingException(com.fasterxml.jackson.databind.JsonMappingException) IOException(java.io.IOException) JsonParseException(com.fasterxml.jackson.core.JsonParseException) AggregatedTabMapping(org.apereo.portal.events.aggr.tabs.AggregatedTabMapping)

Aggregations

AggregatedTabMapping (org.apereo.portal.events.aggr.tabs.AggregatedTabMapping)7 AggregationInterval (org.apereo.portal.events.aggr.AggregationInterval)4 DateDimension (org.apereo.portal.events.aggr.DateDimension)4 TimeDimension (org.apereo.portal.events.aggr.TimeDimension)4 AggregatedGroupMapping (org.apereo.portal.events.aggr.groups.AggregatedGroupMapping)2 JsonParseException (com.fasterxml.jackson.core.JsonParseException)1 JsonMappingException (com.fasterxml.jackson.databind.JsonMappingException)1 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 SortedSet (java.util.SortedSet)1 TreeMap (java.util.TreeMap)1 TreeSet (java.util.TreeSet)1 PortalRenderEvent (org.apereo.portal.events.PortalRenderEvent)1 TabRenderAggregation (org.apereo.portal.events.aggr.tabrender.TabRenderAggregation)1 TabRenderAggregationDiscriminator (org.apereo.portal.events.aggr.tabrender.TabRenderAggregationDiscriminator)1 TabRenderAggregationDiscriminatorImpl (org.apereo.portal.events.aggr.tabrender.TabRenderAggregationDiscriminatorImpl)1 LocalizedString (org.apereo.portal.events.tincan.om.LocalizedString)1 LrsObject (org.apereo.portal.events.tincan.om.LrsObject)1 IPortalRequestInfo (org.apereo.portal.url.IPortalRequestInfo)1