lonpublisher - LON-CAPA publishing handler
lonpublisher is used by mod_perl inside Apache. This is the invocation by loncapa_apache.conf:
<Location /adm/publish> PerlAccessHandler Apache::lonacc SetHandler perl-script PerlHandler Apache::lonpublisher ErrorDocument 403 /adm/login ErrorDocument 404 /adm/notfound.html ErrorDocument 406 /adm/unauthorized.html ErrorDocument 500 /adm/errorhandler </Location>
Authors can only write-access the /~authorname/
space. They can
copy resources into the resource area through the publication step,
and move them back through a recover step. Authors do not have direct
write-access to their resource space.
During the publication step, several events will be
triggered. Metadata is gathered, where a wizard manages default
entries on a hierarchical per-directory base: The wizard imports the
metadata (including access privileges and royalty information) from
the most recent published resource in the current directory, and if
that is not available, from the next directory above, etc. The Network
keeps all previous versions of a resource and makes them available by
an explicit version number, which is inserted between the file name
and extension, for example foo.2.html
, while the most recent
version does not carry a version number (foo.html
). Servers
subscribing to a changed resource are notified that a new version is
available.
lonpublisher takes the proper steps to add resources to the LON-CAPA digital library. This includes updating the metadata table in the LON-CAPA database.
lonpublisher is many things to many people.
This module publishes a file. This involves gathering metadata, versioning the file, copying file from construction space to publication space, and copying metadata from construction space to publication space.
Many of the undocumented subroutines implement various magical parsing shortcuts.
Parameters:
Returns:
nothing
Parameters:
Returns:
Inputs: \%metadata
Returns: (error,status). error is undef on success, status is undef on error.
Returns a 2 element array, the first is the string to be shown to the user, the second is an error code, either 1 (an error occured) or 0 (no error occurred)
Additional documentation needed.
Parameters:
Returns: