Portal Activity Portlet
Step 1: Setting Event Aggregation
The Portal Activity Portlet uses the three aggregations below and can be found listed in uportal-war/src/main/resources/properties/contexts/eventHandlerContext.xml
- org.jasig.portal.events.aggr.action.SearchRequestAggregator
- org.jasig.portal.events.aggr.concuser.ConcurrentUserAggregator
- org.jasig.portal.events/aggr.login.LoginPortalEventAggregator
..... <!-- | Event Aggregators - These run in a single thread on a single node in the portal cluster. They are used to iterate | through all events stored by the portalEventDaoQueuingEventHandler. | | All beans that implement IPortalEventAggregator are used during aggregation +--> <!-- Useful for debugging, logs each event as it is processed by the aggregation system <bean id="loggingPortalEventAggregator" class="org.jasig.portal.events.aggr.LoggingPortalEventAggregator" /> --> <bean id="loginPortalEventAggregator" class="org.jasig.portal.events.aggr.login.LoginPortalEventAggregator"/> <bean id="concurrentUserAggregator" class="org.jasig.portal.events.aggr.concuser.ConcurrentUserAggregator"/> <bean id="tabRenderAggregator" class="org.jasig.portal.events.aggr.tabrender.TabRenderAggregator"/> <bean id="portletAddAggregator" class="org.jasig.portal.events.aggr.portletlayout.PortletLayoutAggregator"/> <bean id="portletExecutionAggregatorAll" class="org.jasig.portal.events.aggr.portletexec.PortletExecutionAggregator"/> <bean id="portletExecutionAggregatorAction" class="org.jasig.portal.events.aggr.portletexec.PortletExecutionAggregator"> <property name="executionType" value="ACTION" /> </bean> <bean id="portletExecutionAggregatorEvent" class="org.jasig.portal.events.aggr.portletexec.PortletExecutionAggregator"> <property name="executionType" value="EVENT" /> </bean> <bean id="portletExecutionAggregatorRender" class="org.jasig.portal.events.aggr.portletexec.PortletExecutionAggregator"> <property name="executionType" value="RENDER" /> </bean> <bean id="portletExecutionAggregatorResource" class="org.jasig.portal.events.aggr.portletexec.PortletExecutionAggregator"> <property name="executionType" value="RESOURCE" /> </bean> <bean id="searchRequestAggregator" class="org.jasig.portal.events.aggr.action.SearchRequestAggregator"/> </beans> 143,1 Bo
For further information see Event Aggregation Configuration and List of Events in uPortal 4.0
Step 2: Defining Groups, Intervals, Terms, and Quarters
By default, the <aggregated-group-config> that is defined in uportal-war/src/main/data/default_entities/event-aggregation/default.event-aggregation.xml specifies groups for the org.jasig.portal.events.aggr.IPortalEventAggregator class, which is a base class for all event aggregator classes.
- In uportal-war/src/main/data/default_entities/event-aggregation/default.event-aggregation.xml, define the groups, intervals, etc... you wish to aggregate
- For example, to define groups, in the <aggregated-group-config> node you can specify which groups you want the portal to aggregate usage on (see excerpt below)
- If you are using PAGS, you can define each of your pags groups by including the pags groupService and the groupName you want to aggregate.
- The <groupName> values must match the value found in the <group-name> node located in uportal-war/src/main/resources/properties/groups/PAGSGroupStoreConfig.xml
<aggregated-group-config> <aggregator-type>org.jasig.portal.events.aggr.IPortalEventAggregator</aggregator-type> <include> <groupService>local</groupService> <groupName>Everyone</groupName> </include> <include> <groupService>pags</groupService> <groupName>All Students</groupName> </include> <include> <groupService>pags</groupService> <groupName>All Staff</groupName> </include> <include> <groupService>pags</groupService> <groupName>All Faculty</groupName> </include> </aggregated-group-config>
- Import your changes by running the command below from the source root
ant data-import -Dfile=uportal-war/src/main/data/default_entities/event-aggregation/default.event-aggregation.xml
For further information see Event Aggregation Configuration
Step 3: Setup the PortalActivity Portlet Preferences
- Modify the uportal-war/src/main/webapp/WEB-INF/portlet.xml file to enable the display of your defined groups in the PortalActivity Portlet
For example, to use the groups defined in Step 2, add the following code snippet within the <portlet-preferences> node:
<preference> <name>PortalActivity.ActivityController.displayGroups</name> <value>All Students</value> <value>All Staff</value> <value>All Faculty</value> </preference>
- Your resulting file should look like this:
<portlet> <portlet-name>PortalActivity</portlet-name> <display-name xml:lang="en">Portal Activity</display-name> <portlet-class>org.springframework.web.portlet.ForwardingDispatcherPortlet</portlet-class> <init-param> <name>contextConfigLocation</name> <value>classpath:/properties/contexts/portlet/PortalActivity-portlet.xml</value> </init-param> <expiration-cache>0</expiration-cache> <supports> <mime-type>text/html</mime-type> <portlet-mode>VIEW</portlet-mode> </supports> <supported-locale>en</supported-locale> <portlet-info> <title>Portal Activity</title> </portlet-info> <portlet-preferences> <preference> <name>PortalActivity.ActivityController.masterGroup</name> <value>Everyone</value> </preference> <preference> <name>PortalActivity.ActivityController.displayOther</name> <value>true</value> </preference> <preference> <name>PortalActivity.ActivityController.displayGroups</name> <value>All Students</value> <value>All Staff</value> <value>All Faculty</value> </preference> </portlet-preferences> </portlet>
The PortletActivity portlet iterates over each group being aggregated. If a group being aggregated is also listed as a value for the displayGroups preference in the portlet.xml the that group's total will be displayed in the PortalActivity's view. If a group being aggregated is not one of the displayGroups values then the totals for that group go in the "other" group totals.
Step 4: Rebuild/Redeploy uPortal
- You will need to redeploy the portal upon importing newly define groups in Step 2 and making modifications to the portlet preferences in Step 3
ant clean deploy-war
Step 5: Restart Tomcat
Restart your tomcat servlet container to activate the change.
Other Information
"People Are Searching For" section
This section uses the aggregation records generated by the SearchRequestAggregator. You will need an aggregation configuration similar to the following in conjunction with the appropriate <aggregated-group-config> settings. The <aggregated-group-config> settings are also found in uportal-war/src/main/data/default_entities/event-aggregation/default.event-aggregation.xml.
<aggregated-interval-config>
<aggregator-type>org.jasig.portal.events.aggr.action.SearchRequestAggregator</aggregator-type>
<include>FIVE_MINUTE</include>
<include>HOUR</include>
<include>DAY</include>
</aggregated-interval-config>
CSS Styling
It was reported that there was some overlapping that was occurring under the usage totals. By modifying the CSS in the file uportal-war/src/main/webapp/WEB-INF/jsp/Activity/activity.jsp and increasing the line-height, this eliminated the problem. Also, depending on the number of groups you display may require you to increase the height of the black boxes.
/* The original .3em line height wasn't enough vertical space and the lines showing the usage totals were overlapping in some browsers. */ .portal-activity .box-data table td { line-height: 1.2em; }
/* You may find that you may need to increase the height of the black boxes to be able to fit all displayGroups. By default, 160px is set. */ .portal-activity .box-outer { height: 160px; background-color: #2E2E2E; }
Results
As for the numbers, if you look at the portlet.xml for the portlet you will see that there are 3 preferences pre-defined: masterGroup, displayOther & displayGroups.
- displayGroups property defines which groups you want to display details for in the portlet, in case you are aggregating on more groups then you want to display.
- masterGroup and displayOther preferences work together to control the "Other" value.
- masterGroup defines which group you might be aggregating on that encompasses the other groups (for example Everyone).
- If displayOther is set to "true" then what we do is we take the total values of the other groups and subtract it from the master group and that is the "Other" value.
For example if you are aggregating on Everyone, Student, Staff and Faculty you will get totals for Student, Staff, Faculty as well as an "Other" group that is anyone that is NOT part of Student, Staff and Faculty.
The values themselves are "unique logins" for specific intervals. "Now" is the last 5 minutes, "Today" is since midnight of the current day and "Yesterday" is the 24 hour timespan of the previous day.
Image provided by: Mark Mace