EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #02037


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] Re: {Disarmed} Re: Re: IRStats2 Beta


Hi Seb,

well, i tried to insert:

sub prepare_select
{
        my( $self, $sql, %options ) = @_;

        if( defined $options{limit} && length($options{limit}) )
        {
                if( defined $options{offset} && length($options{offset}) )
                {
                        $sql .= sprintf(" LIMIT %d OFFSET %d",
                                $options{limit},
                                $options{offset} );
                }
                else
                {
                        $sql .= sprintf(" LIMIT %d", $options{limit} );
                }
        }

        return $self->prepare( $sql );
}

in Handler.pm and restart Apache and i see no change ! I missed something? There is nothing in the logs.


jm

 
Le 20/06/2013 16:02, Sebastien Francois a écrit :
Hi JM,

That's a bug in EPrints::Database::prepare_select (I recall that bug nearly drove me mad!).

See https://github.com/eprints/irstats2/issues/1 and look at my comments for a way to fix that issue.

Seb.


On 19/06/13 08:51, Jean-Marie Le Bechec wrote:
Hi Seb,

the process is ok (create table, etc) :

$ /appli/eprints/archives/oatao/bin/stats/process_stats oatao --setup --verbose
Generating set tables.
Removed table 'irstats2_sets_authors'
Removed table 'irstats2_sets_divisions'
Removed table 'irstats2_sets_subjects'
Removed table 'irstats2_sets_type'
Removed table 'irstats2_groupings_authors'
Removed table 'irstats2_groupings_divisions'
Removed table 'irstats2_groupings_subjects'
Removed table 'irstats2_groupings_type'
Removed table 'irstats2_cache_set_values'
Creating internal tables
About to process dataset 'history'
Creating table 'irstats2_history'
history: starting from record 0
history: 1083209 records to process.
About to process dataset 'access'
Creating table 'irstats2_referrer'
Creating table 'irstats2_browsers'
Creating table 'irstats2_search_terms'
Creating table 'irstats2_downloads'
Creating table 'irstats2_views'
Access: accessid to process: from 0 to 1727808
Access: it took 1 secs to parse 1 records ( average = 1.00 records/sec )
Access: 1 records kept out of 1 ( ratio = 100.00% )
About to process dataset 'eprint'
Creating table 'irstats2_doc_access'
Creating table 'irstats2_deposits'
Creating table 'irstats2_doc_format'
eprint: starting from record 0
eprint: 2652 records to process.
Leaving now

but the results are not (or not complete). I see some informations about eprints database but nothing about downloads! See attached images.

Another thing : Looking where this problem could come I changed the perl path in this file fp_stats.

Thanks

jean-marie


Le 17/06/2013 17:01, Jean-Marie Le Bechec a écrit :
Sol. 1 !

jean-Marie

Le 17/06/2013 16:47, Sebastien Francois a écrit :
Hello Jean-Marie!

On 17/06/13 15:09, Jean-Marie Le Bechec wrote:
Hi Seb,

When i try to execute the script : ./process_stats oatao --setup --verbose

the prompt give me this :

"Generating set tables.
Can't call method "clone" on an undefined value at /appli/eprints/perl_lib/EPrints/Database.pm line 931, <DATA> line 959."

Yep, that rings a bell. The problem is that in EPrints 3.3.9, some of the core DB API has changed (namely "create_tables()") which is very naughty. My code abstracts this and tries to detect the changes but in your instance it seems to have failed to detect your EPrints version.

You can either:

(1) patch EPrints/Plugin/Stats/Handler.pm::_create_table (~line 1198) to:

if( (EPrints->VERSION()||'v3.2.0') gt 'v3.3.8' )

^^ quotes v3.3.8 basically

and test. if that doesn't work, just force the old API call:

(2) same file, same lines:

sub _create_table
{
        my( $self, $tablename, $setkey, @fields ) = @_;

#        if( (EPrints->VERSION()||'v3.2.0') gt v3.3.8 )
#       {
#                return $self->{dbh}->create_table( $tablename, $setkey, @fields );
#        }

        # pre-3.3.9 API
        return $self->{dbh}->create_table( $tablename, undef, $setkey, @fields );
}

and this should work.



My eprints is : EPrints 3.2.4 (Victoria Sponge)

I also have installed "Date::Calc" and added EP_TRIGGER_DYNAMIC_TEMPLATE => 10, (line 123)
EP_TRIGGER_DYNAMIC_TEMPLATE (line 153)

OK for Date::Calc.

I don't think that adding the trigger's constants will help here because you may have the constants defined nicely, but you'll be missing the code which is actually calling the trigger.

And since you're using v3.2.4, I think you'd need to back-port a bit too much code.

Anyway the point of that trigger is to insert some elements in the <head> sections of your template, that's something you can easily do by hand:

- edit your template files (default.xml, perhaps secure.xml)

- add the following into your <head>:

<!-- IRStats2 -->
<script type="text/_javascript_" src="" moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="http://www.google.com/jsapi">MailScanner has detected a possible fraud attempt from "www.google.com" claiming to be "http://www.google.com/jsapi">// <!-- No script --></script>
<script type="text/_javascript_">google.load("visualization", "1", {packages:["corechart", "geochart"]});</script>
<!-- end IRStats2 -->

If you're editing secure.xml, you'll be loading the above page from an HTTPS so technically you should use:

<!-- IRStats2 -->
<script type="text/_javascript_" src="">// <!-- No script --></script>
<script type="text/_javascript_">google.load("visualization", "1", {packages:["corechart", "geochart"]});</script>
<!-- end IRStats2 -->

- reload apache


Merci for your feedback JM - if you get to patch Handler::_create_table, could you let me know which method worked (1 or 2)? This way I can patch the IRStats2.

Seb.


in Const.pm

Any idea ?

Thanks !

Jean-Marie


Le 05/06/2013 15:09, Sebastien Francois a écrit :
Hi Pierre,

I haven't tested on 3.1, I doubt it will work as most of the API is using some "concepts" introduced in 3.2.

Seb.

On 05/06/13 13:47, Nault, Pierre wrote:

Hi Sebastien,

 

                What is the compatibility with eprints 3.1 ?

 

Pierre Nault

 

 

De : eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] De la part de Sebastien Francois
Envoyé : 5 juin 2013 05:56
À : eprints-tech@ecs.soton.ac.uk
Objet : [EP-tech] Re: IRStats2 Beta

 

Hi,

It's a rewrite so I'm tempted to say that everything is different ;-)

The main points are:

- integrated to the EPrints API so configuring, extending etc should be easy if you know EPrints already. It's also rather easy to include graphs etc on pages
- report-based, which can be configured/managed in the local conf
- it can generate data from any EPrints' dataset, not just the download stats (for example: graph of deposits over time, size of the review over time etc...)
- data can be exported to XML, JSON, CSV (should be easy to add other formats if needed)
- uses Google Charts

The main thing for me is that it's easy to customise/extend e.g. you could have reports on citations if you have this enabled on your repository.

You can see a demo there: http://files.eprints.org/cgi/stats/report

Seb.


On 04/06/13 18:34, Centro de Documentación wrote:

Hi Sebastian,

What are the main differences between version 1 and 2?

Of course, Google Charts and  ...

Regards,

 

On Thu, May 30, 2013 at 12:17 PM, Sebastien Francois <sf2@ecs.soton.ac.uk> wrote:

Hi all,

I have added IRStats2 to the eprints GitHub so you may now download and
use/test it.

EPrints 3.3 users may use the bazaar package available from there:
https://github.com/eprints/irstats2/blob/master/epm/irstats2-0.0.2.epm
(note that it's not yet live on the Bazaar-store). Even so you can
install the package easily this way, you still need to run a script to
process the stats. That is not yet automated.

EPrints 3.2 users will have to copy files by hand, it's pretty
straight-forward and the INSTALL file contains some instructions.

It's not quite the final/stable release yet but it has been thoroughly
tested on a few "real" repositories and it's unlikely to break a
repository anyway.

I hope you'll enjoy, please contribute (ideas / comments / bugs etc)
directly to me or to GitHub.

Seb.

PS: yes, it can run in parallel to IRStats1.
*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/

 




*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/

 



*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/



*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/

-- 

***********************************************
Jean Marie Le Bechec
Service Commun de la Documentation
Responsable ingenierie documentaire
&
Direction du Systeme d'Information
Referent Etudes

Institut National Polytechnique de Toulouse
6 allee Emile Monso - bp 34038 -
31029 Toulouse cedex 4
Tel : 05 34 32 31 16
Mail : lebechec@inp-toulouse.fr
*********************************************** 


-- 

***********************************************
Jean Marie Le Bechec
Service Commun de la Documentation
Responsable ingenierie documentaire
&
Direction du Systeme d'Information
Referent Etudes

Institut National Polytechnique de Toulouse
6 allee Emile Monso - bp 34038 -
31029 Toulouse cedex 4
Tel : 05 34 32 31 16
Mail : lebechec@inp-toulouse.fr
*********************************************** 


*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/

-- 

***********************************************
Jean Marie Le Bechec
Service Commun de la Documentation
Responsable ingenierie documentaire
&
Direction du Systeme d'Information
Referent Etudes

Institut National Polytechnique de Toulouse
6 allee Emile Monso - bp 34038 -
31029 Toulouse cedex 4
Tel : 05 34 32 31 16
Mail : lebechec@inp-toulouse.fr
*********************************************** 



*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/

-- 

***********************************************
Jean Marie Le Bechec
Service Commun de la Documentation
Responsable ingenierie documentaire
&
Direction du Systeme d'Information
Referent Etudes

Institut National Polytechnique de Toulouse
6 allee Emile Monso - bp 34038 -
31029 Toulouse cedex 4
Tel : 05 34 32 31 16
Mail : lebechec@inp-toulouse.fr
***********************************************