break;
default:
throw new IllegalArgumentException("Unknow frequency " + freq);
}
Researcher researcher = new Researcher();
Map<String, Map<String,ObjectCount[]>> selectedObject = new HashMap<String, Map<String,ObjectCount[]>>();
Map<String, Map<String,ObjectCount[]>> topObject = new TreeMap<String, Map<String,ObjectCount[]>>();
if (type >= 9)
{
ACrisObject object = as.getEntityByUUID(uuid);
String persistentIdentifier = ResearcherPageUtils
.getPersistentIdentifier(object);
statBean.setObject(object);
statBean.setObjectName(object.getName());
statBean.setObjectURL(ConfigurationManager
.getProperty("dspace.url")
+ "/cris/"
+ object.getPublicPath() + "/" + persistentIdentifier);
statBean.setStatURL(ConfigurationManager
.getProperty("dspace.url")
+ "/cris/stats/"
+ object.getPublicPath()
+ ".html?id="
+ object.getUuid());
statBean.setType(object.getType());
selectedObject = new HashMap<String, Map<String,ObjectCount[]>>();
CrisStatComponentsService statsComponentsService = null;
switch (type)
{
case 9:
statsComponentsService = researcher.getRPStatsComponents();
break;
case 10:
statsComponentsService = researcher.getPJStatsComponents();
break;
case 11:
statsComponentsService = researcher.getOUStatsComponents();
break;
default:
break;
}
selectedObject.put(AStatComponentService._SELECTED_OBJECT, statsComponentsService.getSelectedObjectComponent().getStatsViewComponent().queryFacetDate(statsLogger, object, dateType, dateStart, dateEnd, gap));
selectedObject.get(AStatComponentService._SELECTED_OBJECT).putAll(statsComponentsService.getSelectedObjectComponent().getStatsDownloadComponent().queryFacetDate(statsLogger, object, dateType, dateStart, dateEnd, gap));
for(String key : statsComponentsService.getComponents().keySet()) {
IStatsComponent dual = statsComponentsService.getComponents().get(key).getStatsViewComponent();
topObject.put(key, dual.queryFacetDate(statsLogger, object, dateType, dateStart, dateEnd, gap));
dual = statsComponentsService.getComponents().get(key).getStatsDownloadComponent();
topObject.get(key).putAll(dual.queryFacetDate(statsLogger, object, dateType, dateStart, dateEnd, gap));
}
}
else
{
DSpaceObject dso = HandleManager.resolveToObject(context,
uuid);
if (dso == null)
{
throw new IllegalArgumentException("Invalid handle: "
+ uuid + " DSpace object not found");
}
statBean.setObject(dso);
statBean.setObjectName(dso.getName());
statBean.setObjectURL(ConfigurationManager
.getProperty("dspace.url") + "/handle/" + uuid);
statBean.setType(dso.getType());
switch (dso.getType())
{
case Constants.ITEM:
StatComponentsService serviceItem = researcher.getItemStatsComponents();
retrieveResults(dateType, dateStart, dateEnd, gap,
selectedObject, topObject, dso, serviceItem);
statBean.setStatURL(ConfigurationManager
.getProperty("dspace.url")
+ "/cris/stats/item.html?handle=" + uuid);
break;
case Constants.COLLECTION:
StatComponentsService serviceColl = researcher.getCollectionStatsComponents();
retrieveResults(dateType, dateStart, dateEnd, gap,
selectedObject, topObject, dso, serviceColl);
statBean.setStatURL(ConfigurationManager
.getProperty("dspace.url")
+ "/cris/stats/collection.html?handle=" + uuid);
break;
case Constants.COMMUNITY:
StatComponentsService serviceComm = researcher.getCommunityStatsComponents();
retrieveResults(dateType, dateStart, dateEnd, gap,
selectedObject, topObject, dso, serviceComm);
statBean.setStatURL(ConfigurationManager
.getProperty("dspace.url")