17 import(
'plugins.generic.usageStats.PKPUsageStatsReportPlugin');
19 define(
'OMP_METRIC_TYPE_COUNTER',
'omp::counter');
26 function getMetrics($metricType =
null, $columns =
null, $filters =
null, $orderBy =
null, $range =
null) {
28 if (!(is_scalar($metricType) || count($metricType) === 1))
return null;
29 if (is_array($metricType)) $metricType = array_pop($metricType);
30 if ($metricType !== OMP_METRIC_TYPE_COUNTER)
return null;
32 return parent::getMetrics($metricType, $columns, $filters, $orderBy, $range);
39 return array(OMP_METRIC_TYPE_COUNTER);
46 if ($metricType !== OMP_METRIC_TYPE_COUNTER)
return null;
47 return parent::getMetricDisplayType($metricType);
54 if ($metricType !== OMP_METRIC_TYPE_COUNTER)
return null;
55 return parent::getMetricDisplayType($metricType);
62 if ($metricType !== OMP_METRIC_TYPE_COUNTER)
return array();
64 STATISTICS_DIMENSION_ASSOC_ID,
65 STATISTICS_DIMENSION_ASSOC_TYPE,
66 STATISTICS_DIMENSION_FILE_TYPE,
67 STATISTICS_DIMENSION_REPRESENTATION_ID,
68 STATISTICS_DIMENSION_SUBMISSION_ID,
69 STATISTICS_DIMENSION_CONTEXT_ID,
70 STATISTICS_DIMENSION_SERIES_ID,
71 STATISTICS_DIMENSION_CITY,
72 STATISTICS_DIMENSION_REGION,
73 STATISTICS_DIMENSION_COUNTRY,
74 STATISTICS_DIMENSION_DAY,
75 STATISTICS_DIMENSION_MONTH,
84 if ($metricType !== OMP_METRIC_TYPE_COUNTER)
return array();
89 ASSOC_TYPE_SUBMISSION_FILE
97 $reports = parent::getDefaultReportTemplates($metricTypes);
99 $reports[0][
'nameLocaleKey'] =
'manager.statistics.reports.defaultReport.pressIndexPageViews';
101 $contextReportTemplate = current($reports);
102 $metricType = $contextReportTemplate[
'metricType'];
106 $columns = array(STATISTICS_DIMENSION_ASSOC_TYPE,
107 STATISTICS_DIMENSION_SERIES_ID,
108 STATISTICS_DIMENSION_SUBMISSION_ID,
109 STATISTICS_DIMENSION_MONTH,
110 STATISTICS_DIMENSION_COUNTRY);
111 $filter = array(STATISTICS_DIMENSION_ASSOC_TYPE => ASSOC_TYPE_SUBMISSION_FILE);
112 array_unshift($reports, array(
'nameLocaleKey' =>
'manager.statistics.reports.defaultReport.monographDownloads',
113 'metricType' => $metricType,
'columns' => $columns,
'filter' => $filter,
114 'aggregationColumns' => $aggregationColumns));
117 $filter = array(STATISTICS_DIMENSION_ASSOC_TYPE => ASSOC_TYPE_SUBMISSION);
118 array_unshift($reports, array(
'nameLocaleKey' =>
'manager.statistics.reports.defaultReport.monographAbstract',
119 'metricType' => $metricType,
'columns' => $columns,
'filter' => $filter,
120 'aggregationColumns' => $aggregationColumns));
123 $columns = array(STATISTICS_DIMENSION_ASSOC_TYPE,
124 STATISTICS_DIMENSION_MONTH,
125 STATISTICS_DIMENSION_COUNTRY);
126 $filter = array(STATISTICS_DIMENSION_ASSOC_TYPE => ASSOC_TYPE_SERIES);
127 array_unshift($reports, array(
'nameLocaleKey' =>
'manager.statistics.reports.defaultReport.seriesIndexPageViews',
128 'metricType' => $metricType,
'columns' => $columns,
'filter' => $filter,
129 'aggregationColumns' => $aggregationColumns));