fromFile(cls,
localPath,
description,
semantics,
service,
contentType=None,
suppressMissing=False)
Class Method
| source code
|
constructs a LinkDef based on a local file.
You must give localPath (which may be resdir-relative), description
and semantics are mandatory. ContentType and contentSize will normally
be determined by DaCHS.
You must also pass in the service used to retrieve the file. This
must allow the static renderer and have a staticData property. It should
normally be the datalink service itself, which in a metaMaker is
accessible as self.parent.parent. It is, however, legal to reference
other suitable services (use self.parent.rd.getById or
base.resolveCrossId)
If you pass suppressMissing=True, a link to a non-existing file will
be skipped rather than create a missing datalink.
|