OperationPortletPreferences operationPreferences = preferences.getOperationPortletPreferences();
displayLastCompleted = operationPreferences.useLastCompleted;
displayNextScheduled = operationPreferences.useNextScheduled;
OperationManagerLocal manager = LookupUtil.getOperationManager();
ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();
if (operationPreferences.useLastCompleted) {
PageControl pageControl = new PageControl(0, operationPreferences.lastCompleted);
pageControl.initDefaultOrderingField("ro.createdTime", PageOrdering.DESC);
PageList<ResourceOperationLastCompletedComposite> lastCompletedResourceOps =
manager.findRecentlyCompletedResourceOperations(user.getSubject(), null, pageControl);
disambiguatedLastCompletedResourceOps = DisambiguatedResourceListUtil.disambiguate(
resourceManager, lastCompletedResourceOps, RESOURCE_OPERATION_RESOURCE_ID_EXTRACTOR);
pageControl = new PageControl(0, operationPreferences.lastCompleted);
pageControl.initDefaultOrderingField("go.createdTime", PageOrdering.DESC);
lastCompletedGroupOps = manager.findRecentlyCompletedGroupOperations(user.getSubject(), pageControl);
}
if (operationPreferences.useNextScheduled) {
PageControl pageControl = new PageControl(0, operationPreferences.nextScheduled);
PageList<ResourceOperationScheduleComposite> nextScheduledResourceOps =
manager.findCurrentlyScheduledResourceOperations(user.getSubject(),
pageControl);
disambiguatedNextScheduledResourceOps = DisambiguatedResourceListUtil.disambiguate(
resourceManager, nextScheduledResourceOps, RESOURCE_OPERATION_SCHEDULE_RESOURCE_ID_EXTRACTOR);
pageControl = new PageControl(0, operationPreferences.nextScheduled);
nextScheduledGroupOps = manager.findCurrentlyScheduledGroupOperations(user.getSubject(), pageControl);
}
} catch (Exception e) {
if (log.isDebugEnabled()) {
log.debug("Dashboard Portlet [ControlActions] experienced an error: " + e.getMessage(), e);
} else {