17 import(
'plugins.generic.usageStats.PKPUsageStatsReportPlugin');
19 define(
'OPS_METRIC_TYPE_COUNTER',
'ops::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 !== OPS_METRIC_TYPE_COUNTER)
return null;
32 return parent::getMetrics($metricType, $columns, $filters, $orderBy, $range);
39 return array(OPS_METRIC_TYPE_COUNTER);
46 if ($metricType !== OPS_METRIC_TYPE_COUNTER)
return null;
47 return parent::getMetricDisplayType($metricType);
54 if ($metricType !== OPS_METRIC_TYPE_COUNTER)
return null;
55 return parent::getMetricDisplayType($metricType);
62 if ($metricType !== OPS_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_CITY,
71 STATISTICS_DIMENSION_REGION,
72 STATISTICS_DIMENSION_COUNTRY,
73 STATISTICS_DIMENSION_DAY,
74 STATISTICS_DIMENSION_MONTH,
83 if ($metricType !== OPS_METRIC_TYPE_COUNTER)
return array();
86 ASSOC_TYPE_SUBMISSION,
87 ASSOC_TYPE_SUBMISSION_FILE
95 $reports = parent::getDefaultReportTemplates($metricTypes);
97 $reports[0][
'nameLocaleKey'] =
'manager.statistics.reports.defaultReport.journalIndexPageViews';
99 $contextReportTemplate = current($reports);
100 $metricType = $contextReportTemplate[
'metricType'];
104 $columns = array(STATISTICS_DIMENSION_ASSOC_TYPE,
105 STATISTICS_DIMENSION_ASSOC_ID,
106 STATISTICS_DIMENSION_SUBMISSION_ID,
107 STATISTICS_DIMENSION_MONTH,
108 STATISTICS_DIMENSION_COUNTRY);
109 $filter = array(STATISTICS_DIMENSION_ASSOC_TYPE => ASSOC_TYPE_SUBMISSION_FILE);
110 array_unshift($reports, array(
'nameLocaleKey' =>
'manager.statistics.reports.defaultReport.articleDownloads',
111 'metricType' => $metricType,
'columns' => $columns,
'filter' => $filter,
112 'aggregationColumns' => $aggregationColumns));
115 $filter = array(STATISTICS_DIMENSION_ASSOC_TYPE => ASSOC_TYPE_SUBMISSION);
116 array_unshift($reports, array(
'nameLocaleKey' =>
'manager.statistics.reports.defaultReport.articleAbstract',
117 'metricType' => $metricType,
'columns' => $columns,
'filter' => $filter,
118 'aggregationColumns' => $aggregationColumns));