Where are the ALM plugin in OJS 2.4.7.1?

Hello PKP Community!

Recently we updated an OJS to the latest version OJS 2.4.7.1, and we could not find the ALM plugin that we used to activate in: Home > User > Journal Management > Plugin Management > Generic Plugins.

In the previous versions we have activated the ALM plugin to show the PDF and HTML downloads and it used to work smoothly.

Did you change the location of ALM in the user interface?

Could you tell us if you missed this plugin or where is it?

Thanks in advance,

Arley Soto

Hi @asoto,

We’ve stopped distributing the ALM plugin with OJS for the moment. The service is in beta and isn’t especially reliable yet. It’s been moved into a separate repository:
https://github.com/pkp/ALM/tree/ojs-stable

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Thank you Alec!

We have add the plugin to the OJS instance and works perfect to show download statistics, which is our main interest by now.

Regards,

Arley

Dear @asoto<

Please, help me how to reinstall ALM plugin on OJS 2.4.7.1?

Regards,

Dear @MirkoSpiroski,

do you still need help installing the ALM plugin?
Its pretty straightforward:

  1. Download the code (either by cloning https://github.com/pkp/ALM/tree/ojs-stable or by downloading and unpacking https://github.com/pkp/ALM/archive/ojs-stable.zip ).

  2. Copy/Move all files and directories from the ALM (for the clone) or ALM-oj-stable (for the unpacked zip-file) directory to …/plugins/generic/alm/ (note the lowercase “alm”!).

If you are still using 2.4.7.1 you will have to upgrade to 2.4.8: How to setup alm at localhost for testing in ojs - #2 by hermann

Greetings
Hermann

Dear hermann,

Thabk you very much for your help. I install ALM, but the previous data are not presented. Can you suggest me how to upgarde the previous data?

Best regards,
Mirko Spiroski

Dear @MirkoSpiroski,

what I did was this:
Furtunately I still had access-log files of my web-server (Apache) for the time I had OJS 2.4.7.1 installed.
Those were in one file per week and compressed with gzip (logrotate does that for me).
As this webserver not only serves OJS I extracted just the lines concerning OJS article downloads. E.g.

zgrep 'ojs.*article/download' access_log-20160306.gz > /tmp/ojs_downloads-20160306.log

I created one ojs_downloads… file for each original access_log-file. Then I copied those files to the usageStats/stage folder (inside the files_dir configured in config.inc.php) and ran

php tools/runScheduledTasks.php plugins/generic/usageStats/scheduledTasksExternalLogFiles.xml

after changing to my OJS-installation directory.
Before you run that command please check that the Parse log files regex in the settings of the Usage Statistics plugin in Journal Management > Plugin Management > Generic Plugins
matches the format of your log-files. For “Apache combined” I used
/^(?P<ip>\S+) \S+ \S+ \[(?P<date>.*?)\] "\S+ (?P<url>\S+).*?" (?P<returnCode>\S+) \S+ ".*?" "(?P<userAgent>.*?)"/

You may have to change that if your access-log is not from Apache or not in the “combined” format.
To check if the apache-logs where imported you can use this SQL-command:
select load_id from metrics where load_id not like 'usage_events%';
which should output quite some rows with the names of the access-log files you had put into the usageStats/stage directory.

Hope this is helpful.
Greetings
Hermann

1 Like

Note that there is an OJS native utility (tools/copyAccessFileLogTool.php) for the zgrep step. There are a copy of other URI paths that might be useful to harvest out of the old logs.

@ctgraham,
thanks for the hint, I did not know this tool exists!

I tried to use it but I think I found a problem. When I call it e.g. like this
php tools/copyAccessLogFileTool.php /var/log/httpd/access_log-20160327.gz
I get this error-message:
/bin/egrep: /path/to/ojs_files/usageStats/tmp/access_log-20160327: No such file or directory

As far as I can tell the problem is that such a compressed file gets decompressed using FileManager::decompressFile() using the original file path as argument but not the temporary file path! So the original file gets decompressed and the copied one stays compressed.

Changing $filePath to $tmpFilePath in that call fixes the problem:

--- tools/copyAccessLogFileTool.php.orig        2016-04-01 10:16:27.684302000 +0200
+++ tools/copyAccessLogFileTool.php     2016-04-01 10:36:23.536839000 +0200
@@ -178,7 +178,7 @@
                if ($isCompressed) {
                        $fileMgr = new FileManager();
                        $errorMsg = null;
-                       if (!$fileMgr->decompressFile($filePath, $errorMsg)) {
+                       if (!$fileMgr->decompressFile($tmpFilePath, $errorMsg)) {
                                printf($errorMsg . "\n");
                                exit(1);
                        }

Greetings
Hermann

1 Like

Good spotting. Would you be able to open this as an issue in GitHub and submit the change as a pull request?

Hi @ctgraham,

I would open an issue and make a pull request gladly, but I am a bit unsure how to proceed as

  1. I saw that in the master branch this problem is fixed: pkp/pkp-lib#1000: port compressing archived files · pkp/pkp-lib@93598fa · GitHub

  2. In the other ojs-… branches the file is missing in the tools directory!

Greetings
Hermann

For OJS 2.4.x bugs, the branch to check out for a pull request is ojs-dev-2_4.

OK, thanks, I thought so. But the file is not in pkp/pkp-lib but in pkp/ojs. So I created a pull reqeust in that one:

I could not open an issue as this is disabled for GitHub - pkp/ojs: Open Journal Systems (?) but maybe that’s not necessary for such a small change anyway?

Hi @hermann,

We manage issues in the http://github.com/pkp/pkp-lib repository, which is a library shared by several of our applications, because issues are frequently cross-application. But not a big deal, I’ve assigned the PR to one of our developers.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi. I am using 2.4.8.1 but both mentioned links are not working to download ALM plugin. Please provide me the link if available.

The former ALM service has been retired in favor of a plugin development based on a partnership with ImpactStory. I don’t believe this work will be ported back to OJS 2.x, however.

For 2.x, you might consider the Plum Analytics plugin to expose article level metrics on your article pages, if you use DOIs for your articles.

Thank your for the information. I have installed the plugin and Plum Analytics Artifact Widget Settings is required. Please advised as necessary.

You can find examples of the widgets and what kinds of settings apply to each type of widget here:
https://plu.mx/plum/developers/widgets

This plugin simply provides a configurable interface to the widget code described on that page.

I have visited the page and I have read all the information. I want to show it below the abstract of each tittle but unable to do so yet.
The picture is given below if it is possible please suggest me the settings.
image

I was trying to download ALM plugin form 2.4.8 https://github.com/pkp/ALM/archive/ojs-stable.zip but unable to find anything. Please provide any other link.