Podius::Property::Publishable - Publishable 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 publishable component property.
The subclasses may control the filenames and their contents to be
published.
the Podius::Property manpage.
- description
-
Class constructor.
- parameters
-
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 formed property reference.
- description
-
The default implementation is good for subclasses that use internal
fields ``filename'' (or ``filenames'') and ``content_ref'' (or ``content_refs'').
Such subclasses should not necessarily overwrite this method.
- parameters
-
Optional boolean flag indicating unpublishing. Note, the returned
content_sub is supposed to be used (called) on publishing only.
- returns
-
Arrayref of hashes with keys ``filename'', ``content_sub'', and possibly
others like ``label''.
- parameters
-
* optional index inside B<get_files_to_publish>, or filename, default 0
- returns
-
Scalar (file name), or undef.
- parameters
-
* optional index inside B<get_files_to_publish>, or filename, default 0
- returns
-
Scalar (directory name part of the file name), or undef.
- parameters
-
* optional index inside B<get_files_to_publish>, or filename, default 0
- returns
-
Scalar (base name part of the file name), or undef.
- parameters
-
* optional index inside B<get_files_to_publish>, or filename, default 0
- returns
-
Scalar (extention part of the file name), or undef.
- description
-
This method is intended to be overwritten in subclasses to return the
corresponding Content-Type: string, for example Video subclass may return
``video/mpeg''.
-
A convention for subclasses is to return a common pattern if the given
parameter (file name) has no extention or has unknown extention. For
example: possible input ``*'', possible output ``video/*''.
- parameters
-
* optional index inside B<get_files_to_publish>, or filename, default 0
- returns
-
The default implementation returns always ``application/octet-stream'',
or ``*/*'' if the input is ``*''. Or undef, if there is no requested file.
- description
-
This method is intended to be overloaded in subclasses to apply more
initializations when the property is reset.
-
The default implementation is to unpublish this property (using its
owner component), this removes exiting published files if any.
- parameters
-
None.
- returns
-
None.