Skip to main content

EEA Downloads Media Storage

Project description

http://ci.eionet.europa.eu/job/eea.downloads-www/badge/icon http://ci.eionet.europa.eu/job/eea.downloads-plone4/badge/icon

EEA Downloads (Media Storage) mounts a file-system directory within ZODB

Contents

Main features

  1. Mounts a file-system directory within ZODB

Install

  • Within your buildout define environment-vars per instance:

    [instance]
    environment-vars +=
      EEADOWNLOADS_NAME downloads
      EEADOWNLOADS_PATH ${buildout:directory}/var/downloads
  • Make sure that registered file-system directory exists and the zope effective-user has read access there:

    $ mkdir -p var/downloads
  • Add eea.downloads to your eggs section in your buildout and re-run buildout:

    [instance]
    eggs +=
      eea.downloads
    zcml +=
      eea.downloads
  • You can download a sample buildout from https://github.com/eea/eea.downloads/tree/master/buildouts/plone4

  • Install eea.downloads within Site Setup > Add-ons

Getting started

  1. Login to ZMI

  2. Navigate to Plone > downloads

Storage adapter

This package defines a storage interface IStorage that you can use to get generated files system paths and Plone related URLs. Default strategy of storing files is:

EEADOWNLOADS_PATH / UID / MODIFIED / ID.EXTENSION

Here is an example:

>>> from eea.downloads.interfaces import IStorage
>>> store = IStorage(context).of('pdf')
>>> store.filepath()
'/opt/downloads/uid-21323e2321312/3213213/context-id.pdf'

>>> store.absolute_url()
'http://localhost:8080/Plone/downloads/uid-21323e2321312/3213213/context-id.pdf'

You can always provide a custom IStorage adapter for your Zope objects if you need other file-system storage layout.

Dependencies

  1. Products.CMFCore

  2. collective.monkeypatcher

Source code

Funding

EEA - European Environment Agency (EU)

Changelog

1.0 - (2014-09-15)

  • Upgrade step: Within “Plone > Site setup > Add-ons” install EEA Downloads [voineali refs #20677]

  • Pre-upgrade step: Make sure that the folder defined within EEADOWNLOADS_PATH exists on disk and Zope effective-user has read and write access within it. If you use ZEO and have more that one Zope instance, this folder should be shared for all Zope instances. [voineali refs #20677]

  • Pre-upgrade step: Within your buildout define environment-vars per instance: EEADOWNLOADS_NAME and EEADOWNLOADS_PATH [voineali refs #20677]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eea.downloads-1.0.zip (29.8 kB view details)

Uploaded Source

File details

Details for the file eea.downloads-1.0.zip.

File metadata

  • Download URL: eea.downloads-1.0.zip
  • Upload date:
  • Size: 29.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for eea.downloads-1.0.zip
Algorithm Hash digest
SHA256 202a508aabb5705dd0e43fc02ea6cec35d678d2fe7f8855348259460674c44ba
MD5 d85f4188ade9adf379f5d52a45f3e09a
BLAKE2b-256 22103387f73b31623b257c8a42dba82a42258b3a559f4a6e62d46c95a8b7cbf4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page