Scroll to navigation

Sympa::WWW::SharedDocument(3Sympa) sympa 6.2.58 Sympa::WWW::SharedDocument(3Sympa)


Sympa::WWW::SharedDocument - Shared document repository and its nodes


  use Sympa::WWW::SharedDocument;
  $shared = Sympa::WWW::SharedDocument->new($list, $path);
  %access = $shared->get_privileges('read', $email, 'md5', {...});
  @children = $shared->get_children;
  $parent = $shared->{parent};


Sympa::WWW::SharedDocument implements shared document repository of lists.


Constructor. Creates new instance.


A Sympa::List instance.
String to determine path or arrayref of path components. The path is relative to repository root.
Don't omit files with zero size.


If $path is empty or not specified, returns new instance of repository root; {status} attribute will be set. If $path is not empty and the path exists, returns new instance of node. Otherwise returns false value.

Instance method. Casts the instance to hashref.




A hashref including attributes of instance (see "Attributes") and following special items:

Arrayref of hashrefs including some attributes of all ancestor nodes.
Hashref including name and host of the list.
Localized form of {date_epoch}.
Hashref including attributes of parent node recursively.
Same as {paths} but, if the node is a directory, includes additional empty component at the end. This is useful when the path created by join() should be followed by additional "/" character.
Instance method. Returns number of child nodes.
Instance method. Returns number of nodes waiting for moderation.
Instance method. Creates child node and returns it. TBD.
Instance method. Gets child nodes.


Filters results.
Sorts results. $order may be one of 'order_by_doc' (by name of nodes), 'order_by_author' (by owner), 'order_by_size' (by size), 'order_by_date' (by modification time). Default is ordering by names.
Don't omit nodes with zero size.


(Possibly empty) list of child nodes.

Instance method. Returns the list of nodes waiting for moderation.




In array context, a list of nodes. In scalar context, an arrayref of them.

Instance method. Gets privileges of a user on the node.


Instance method. Gets total size under current node.
Instance method. Approves (install) file if it was held for moderation.


True value. If installation failed, returns false value and sets $ERRNO ($!).

Instance method. Renames file or directory.


The name to be renamed to.


True value. If renaming failed, returns false value and sets $ERRNO ($!).

instance method. Removes directory from repository. Directory must be empty.


True value. If removal failed, returns false value and sets $ERRNO ($!).

Instance method. Creates or updates property description of the node.
instance method. Removes file from repository.


True value. If removal failed, returns false value and sets $ERRNO ($!).

Instance method. Returns unique identifier of instance.

Methods for repository root

Instance method. Creates document repository on physical filesystem.
Instance method. Deletes document repository.
Instance method. Restores deleted document repository.


Function. Check if the name is allowed for directory and file.

Note: This should be used with name of newly created node. Existing files and directories may have the name not allowed by this function.


Instance of Sympa::WWW::SharedDocument may have following attributes.

Mandatory. Instance of Sympa::List class the shared document repository belongs to.
Mandatory. Modification time of node in Unix time.
File extension if any.
Mandatory. Name of node on physical filesystem, i.e. the last part of {fs_path}.
Mandatory. Full path of node on physical filesystem.
Only in HTML file. True value will be set.
URL to icon.
Only in bookmark file. Label to be shown in hyperlink.
Only in regular file. MIME content type of the file if it is known.
Set if node is held for moderation.
Mandatory. Name of node accessible by users, i.e. the last item of {paths}.
Owner (author) of node, given by property description.
Parent node if any. Sympa::WWW::SharedDocument instance.
Mandatory. Arrayref to all path components of node accessible by users.
Scenario names to define privileges. These may be given by property description.
Modification time of property description in Unix time. Available if property description exists.
Size of file.
Only in repository root. Status of repository: 'exist', 'deleted' or 'none'.
Description of node, given by property description.
Mandatory. Type of node. 'root' (the root of repository), 'directory' (directory), 'url' (bookmark file) or 'file' (other file).
Only in bookmark file. URL to be linked.


Root of repository.
... path/name
Directory or file.
... path/.name.moderate
Moderated directory or file.
... path/name/.desc
... path/
... path/
Property description of directories or files, not moderated or moderated.

Note: The path components ("name" above) are encoded to the format suitable to physical filesystem. Such conversion will be hidden behind object methods.


Sympa::List, "qdecode_filename" in Sympa::Tools::Text, "qencode_filename" in Sympa::Tools::Text.


SharedDocument module appeared on Sympa 5.2b.2.

Rewritten Sympa::SharedDocument began to provide OO interface on Sympa 6.2.17.

It was renamed to Sympa::WWW::SharedDocument on Sympa 6.2.26.

2020-12-30 6.2.58