:::

DSpace 1.5統計功能無法開啟的問題

7月 23, 2008 , 0 Comments Edit Copy Download

參考資料來自於這篇:DSpace statistics(统计问题) - 上善若水.class - CSDNBlog

如果你下載的DSpace 1.5版無法正常啟用統計功能(statistic),可能是因為原始碼的API寫錯了。

請修改LogAnalyser.java,可以善用locate幫忙搜尋:

#vim [dspace-source]/dspace-api/src/main/java/org/dspace/app/statistics/LogAnalyser.java

將1216行多餘的「"FROM metadatavalue " +」註解掉,結果如下:

dateQuery.append("FROM metadatavalue " +
                  //"FROM metadatavalue " +
                  "WHERE metadata_field_id = (" +
                  " SELECT metadata_field_id " +
                  " FROM metadatafieldregistry " +
                  " WHERE element = 'date' " +
                  " AND qualifier = 'accessioned') ");

然後重新打包,請參考DSpace System Documentation_ V1.5 - May 2008.pdf 84頁的rebuild the DSpace Web application:

#cd [dspace-source]/dspace
#mvn package

等待mvn打包結束之後,再執行ant佈署:

#cd [dspace-source]/dspace/target/dspace-[version].dir
#ant -Dconfig=[dspace]/config/dspace.cfg update

等待ant佈署結束之後,再複製新的war到tomcat的webapps目錄:

#\cp -rf /dspace/webapps/ /opt/apache-tomcat-6.0.16/webapps/

這樣用以下指令執行統計功能就不會出現問題了。

#[dspace]/bin/stat-initial
#[dspace]/bin/stat-general
#[dspace]/bin/stat-monthly
#[dspace]/bin/stat-report-initial
#[dspace]/bin/stat-report-general
#[dspace]/bin/stat-report-monthly
image