buckets-1

Define buckets and what can be placed in them.

Buckets are groups within file where children files can be placed. Buckets are used to access those groups of files separately.

The buckets-1 file type is only intended to be used on .Buckets files.

Usage

Set the body of a buckets-1 file to the desired accept rules.

Note that you have to set the body, not file attributes!

The body must be a valid JSON array, having one ore more objects as in the following schema:

[
    {
        "name": "bucketName",
        "title": "Bucket title",
        "interface": ".Inline"
    }
]
  • The name must be a valid bucket name.
  • The title is optional, when provided, it must be a human readable title (no control chars). It can also be left blank in which case the bucket name shall be used on user interfaces.
  • The interface must be a list of Boomla app method names that files must implement to be accepted in the bucket.

You can validate the JSON string at jsonlint.com if you want.

Interface

The interface value must be a space separated lists of app methods.

Most commonly used methods are:

  • .Inline,
  • .Request,
  • .Page.

There are 2 special values:

  • .Image - currently only the built-in image-1 app implements it, and
  • .None - which can not be implemented.

You can also use user-space methods, like .foo. User-space methods start with a dot followed by a lower-case letter. This allows you to create applications that only allow one to drop specific file types - those that implement that unique interface.

Validating a .Buckets file

Open it in your browser to validate it.

Examples

Define bucket main and accept contents

[
    {
        "name": "main",
        "title": "",
        "interface": ".Inline"
    }
]

Define bucket main and accept any file

[
    {
        "name": "main",
        "title": "",
        "interface": ""
    }
]

Define bucket main and don’t accept anything

[
    {
        "name": "main",
        "title": "",
        "interface": ".None"
    }
]

Define the Pages bucket and accept pages

[
    {
        "name": "Pages",
        "title": "",
        "interface": ".Page .Request"
    }
]

Define the images bucket and accept images

[
    {
        "name": "images",
        "title": "",
        "interface": ".Image"
    }
]

Define buckets left and right, accept contents in both

[
    {
        "name": "left",
        "title": "",
        "interface": ".Inline"
    },
    {
        "name": "right",
        "title": "",
        "interface": ".Inline"
    }
]

Implemented OS Interfaces

.Request

Note on sections

There was a concept called sections that was used to solve the same problem as buckets except with regular files. They are being phased out.