[librecat-dev] hook for after file is uploaded

Jonathan NORRIS jnorris at ist.ac.at
Thu May 17 16:36:53 CEST 2018

By 'file_name' do you mean only the file name or the full file path? If 
so its possible to index the full file path in a layer?

It seems that when I use 'my $pub = publication->get(123);', I can 
access the file information with '$pub->{file};':

     access_level => "open_access",
     content_type => "application/pdf",
     creator => "system",
     date_created => "2018-05-08T13:52:35Z",
     date_updated => "2018-05-08T13:52:35Z",
     file_id => 4348,
     file_name => 
     file_size => 187419,
     open_access => 1,
     relation => "main_file",

I could use this along with a Linux find command to find the file from 
the file_store root.

Basically I am trying to add a feature for prepending pdf cover pages 
(generated from html templates) to certain types of publications after 
the file has been uploaded to the file system. I just need the right 
hook and the path to the particular files.



On 05/17/2018 01:48 PM, Patrick Hochstenbach wrote:
> No,
> The publication-new hook is executed when a user filling in a new publicaton from scratch. You probably want to look at the publication-update hook …this is when the changes are written back to the disks/databases.
> The file_name of a particular uploaded file to a record is not indexed by default in the search index (you can do this in a local layer configuration if you want). Or,
> use a Linux ‘find’ command in the configured filestore.default.options.root directory
> Patrick
>> On 17 May 2018, at 13:02, Jonathan NORRIS <jnorris at ist.ac.at> wrote:
>> Hello,
>> About the 'publication-new: after-fixes' hook, will this be ran after the the publication file has been uploaded to the file system?
>> And also, is there a way in librecat to query for the file system location of a publication's file?
>> Thanks,
>> Jonathan
>> IST Austria
>> _______________________________________________
>> librecat-dev mailing list
>> - send list mails to librecat-dev at lists.uni-bielefeld.de
>> - to unsubscribe or change options, visit https://lists.uni-bielefeld.de/mailman2/cgi/unibi/listinfo/librecat-dev
>> - project website: http://librecat.org/

More information about the librecat-dev mailing list