tripal / tripal_file

Manages site-wide files and associates them with content in a Tripal site.
1 stars 2 forks source link

Issue #5 Allow public:// prefix for local unmanaged files #13

Closed dsenalik closed 3 years ago

dsenalik commented 3 years ago

This partially addresses issue #5 and issue #4 by allowing files already on the filesystem, but not managed by Tripal, to be linked using a public:// prefix. This allows the files to have size and md5 checksum values populated. For example I tested with both a URL and a file in an existing heirarchy

https://static-content.springer.com/esm/art%3A10.1186%2F1471-2164-12-389/MediaObjects/12864_2011_3596_MOESM2_ESM.FASTA
public://bulk_data/carrotomics/sequence/est-assembly1/12864_2011_3596_MOESM2_ESM.FASTA.gz

20210310_downloadexample

spficklin commented 3 years ago

This is a nice addition @dsenalik thanks for submitting. I just have one code change request that's simple and noted above.

dsenalik commented 3 years ago

I've had some thoughts about reworking this a bit to be more robust. watch for an update

dsenalik commented 3 years ago

Enhanced validation and I renamed "local" to "managed" and "remote" to "unmanaged" to hopefully make things more clear, since remote included local files when not managed by tripal. I hope this doesn't break anything. I also came across two additional bugs and fixed them

  1. files with ftp:// prefix lost their url because they were eaten by file_create_url(), this change is in schema_itemlocation.inc
  2. my site name wasn't substituted because it is using https instead of http, this change is in schema_itemlocation_formatter.inc
spficklin commented 3 years ago

This change looks good. I think we can commit and if anything else arises that we didn't see we can fix later. Thanks for all the fixes!