Podius::Property::Multimedia - Multimedia component property
This is an abstract superclass.
Supposed to be used in the Podius::Component manpage and the Podius::Property manpage
module trees only.
This module implements general multimedia component property.
It can be subclassed to add specific meaning to stored scalar raw data
(possibly binary).
Multimedia properties manage 3 things:
* binary raw-data
* filename
* label
the Podius::Property::Publishable manpage, the Exception manpage.
- description
-
Class constructor.
- parameters
-
The same as in superclass. Class name and optional parameters:
-
* hashref (may be omitted) with keys 'prefix' or others
* default filename
* default label
* scalarref raw-data
- returns
-
New property object.
- description
-
Class constructor. Used for deserialization.
- parameters
-
Class name (like all constructors) and array ref
[ content_ref, filename, label ].
Additional parameters are property static parameters (if any).
- returns
-
New property object.
- description
-
Used for serialization.
- returns
-
String (in this case array ref), representing the property, from which
the property can be restored later by new_from_serialized constructor.
- parameters
-
Accessor: none.
-
Modifier: property value to set (raw-data-ref) - ref to scalar.
ref to undef means unset the value.
- returns
-
Property value (raw-data-ref) - ref to scalar.
ref to undef means no property value is set.
- parameters
-
Accessor: none.
-
Modifier: scalar (label).
- returns
-
Scalar (label).
- parameters
-
Accessor: none.
-
Modifier: scalar (file-name).
- returns
-
Scalar (file-name).
- parameters
-
Accessor: none.
-
Modifier: scalar (base-name, last element of file-name, see access_filename).
- returns
-
Scalar (base-name, last element of file-name, see access_filename).
- parameters
-
None.
-
Only accessor form is available.
- returns
-
Possibly long and binary string of the multimedia content.
- parameters
-
None.
-
Only accessor form is available.
- returns
-
0 or 1 depending on whether multimedia data is set or not.
- parameters
-
None.
-
Only accessor form is available.
- returns
-
Integer that is the size of the multimedia content.
- description
-
This method replaces the property data with the contents of the local file.
-
If file does not exists, then the property is not touched and undef is
returned.
- parameters
-
* mandatory filename
* optional label (by default it is constructed from filename)
- returns
-
Self on success, undef on failure to load file. It is possible the
exception is thrown on file-system problems (should not usually happen).
- description
-
This method replaces the property data with the file fetched from the
given url using LWP::Simple::get.
-
If url is broken, then the property is not touched and undef is returned.
- parameters
-
* mandatory url
* optional label (by default it is constructed from filename)
- returns
-
Self on success, undef on failure to fetch url.
- description
-
This method replaces the property data with the web-uploaded file using
the multipart/form-data web mechanism.
-
If no file was uploaded, then the property is not touched and undef is returned.
- parameters
-
* optional form param name (by default the property name is used)
* optional label (by default it is constructed from filename)
- returns
-
Self on success, undef on no file uploaded.
- description
-
This method removes the property data.
- parameters
-
None.
- returns
-
Self.