如何在DSpace统计信息中显示前50个查看次数最多的项目

时间:2017-01-18 04:27:20

标签: xslt-1.0 dspace

以站点管理员身​​份登录后,您可以通过单击侧栏(管理)菜单中的统计信息链接来访问统计页面。该页面看起来像这样(来自DSpace Demo):

enter image description here

根据上图,显示包含20个或更多视图的所有项目。是否可以将其更改为仅显示前50个(或任意数字)最常查看的项目,无论它是否具有20个或更多视图?因此,我希望将其更改为已查看的前50个项目,而不是已查看的项目。此外,默认情况下,列表仅显示前10个查看次数最多的项目的标题,而其余项目仅为网址。如何修改它以显示剩余项目的标题?

更新

我发现item.floor中的item.lookup[dspace]/config/dstat.cfg设置如果从默认值更改,则会被忽略。我在JIRA中提交了此问题:DS-3470

关于仅显示前50个项目,这是我的xslt代码:

<xsl:template match="dri:div[@id='aspect.artifactbrowser.StatisticsViewer.div.items_viewed']/dri:table[@id='aspect.artifactbrowser.StatisticsViewer.table.reportBlock']">
    <table class="ds-table table table-striped table-hover detailtable">
        <xsl:for-each select="dri:row[position() &lt;=51]">
            <xsl:apply-templates select="."/>
        </xsl:for-each>
    </table>
</xsl:template>

我正在为此实例使用DSpace版本6(XMLUI)。

提前致谢。

4 个答案:

答案 0 :(得分:2)

答案 1 :(得分:2)

我不认为可以配置报告返回的项目数量。您可能需要查看代码,此处和下一行:https://github.com/DSpace/DSpace/blob/269af71afb602808a14edf822ad658c3895e0a37/dspace-api/src/main/java/org/dspace/app/statistics/ReportGenerator.java#L331

在该报告中考虑项目之前所需的观看量阈值确实可以在Terry提到的文件中配置。

据我所知,标题将一直显示,如果可用的话。在demo.dspace.org上,屏幕截图中的链接指向不再存在的项目(但我猜这仍然存在于SOLR核心中)。我相信这不会发生在“真正的”DSpace上,而只是每周数据刷新的结果。

此致 伯努瓦

答案 2 :(得分:1)

您可以在dstat.cfg中配置标题查找次数(如Terry所述)。 https://github.com/DSpace/DSpace/blob/master/dspace/config/dstat.cfg#L71

# limit the number of lookups of titles and authors to the first X.  Lookup
# invokes the java environment so has quite an impact on performance.
item.lookup=10

答案 3 :(得分:0)

好的,我发现为了反映dstat.cfg中所做的更改,您需要做的就是重新运行dspace stat-initial。关于仅显示前50个被查看项目,我使用了以下代码:

<xsl:template match="dri:div[@id='aspect.artifactbrowser.StatisticsViewer.div.items_viewed']/dri:table[@id='aspect.artifactbrowser.StatisticsViewer.table.reportBlock']">
    <table class="ds-table table table-striped table-hover detailtable">
        <xsl:for-each select="dri:row[position() &lt;=51]">
            <xsl:apply-templates select="."/>
        </xsl:for-each>
    </table>
</xsl:template>

希望这可以帮助任何有类似问题的人。感谢Andrea,Terry和Benoît的回答。