Closed lukasgraf closed 11 years ago
Products.PortalTransforms.TransformEngine:532
When trying to install a policy for an output type that already has a policy, a TransformException
is raised.
Products.PortalTransforms.TransformEngine.TransformTool.convertTo:139
## fastpath
# If orig_mt and target_mt are the same, we only allow
# a one-hop transform, a.k.a. filter.
# XXX disabled filtering for now
if orig_mt == str(target_mt):
data.setData(orig)
md = data.getMetadata()
md['mimetype'] = str(orig_mt)
if object is not None:
cache.setCache(str(target_mimetype), data)
return data
This is done by first looking for a subpath leading from INPUT to INPUT_OF_FIRST_TRANSFORM_IN_CHAIN. If such a path is found, TransformTool._findPath()
is called recursively with the remaining transforms from the chain as requirements, working its way trough the chain.
So to summarize: If a policy exists, and one or more paths exists to satisfy the policy, the shortest path satisfying that policy is chosen. Choosing the shortest path from the candidates is done using the same logic that's used when no policies exist.
TransformTool._mtmap
. Which is a PersistentMapping
(dictionary), so its order is undefined.=> Without a policy, which of two equally short paths will be selected is undetermined.
text/plain
installed.Conclusion:
ftw.tika
's transform is chosen with the highest prioritytext/plain
to be installed on a fresh Plone
The
portal_transforms
tool is largely undocumented.Currently I'm not 100% clear about how decides which transform to pick if more than one transform with a direct path from INPUT to OUTPUT exists, and how transform policies factor into pathfinding.
Figure out how all this works, and modfiy our installation and uninstallation functions in
setuphandlers.py
accordingly.