The z3c.pt-package now provides a template class for plain text files like .css and .js---using the ${<python expression>}-syntax. I'd like to integrate it with browser resources such that filename.css.<some extension for z3c.pt text templates> would be sent through the template engine. Now, the DirectoryResource-class defined in zope.app.publisher.browser.directoryresource provides a dictionary of resource factories for a number of standard file extensions. Shouldn't this be pluggable using the component architecture? It would adapt to IResourceFactory. \malthe
On Feb 23, 2008, at 10:53 PM, Malthe Borch wrote:
The z3c.pt-package now provides a template class for plain text files like .css and .js---using the ${<python expression>}-syntax.
I'd like to integrate it with browser resources such that
filename.css.<some extension for z3c.pt text templates>
would be sent through the template engine.
Now, the DirectoryResource-class defined in zope.app.publisher.browser.directoryresource provides a dictionary of resource factories for a number of standard file extensions.
Shouldn't this be pluggable using the component architecture? It would adapt to IResourceFactory.
+1. Some more details would need to be worked out. For example, to work for your use case, it would need to be involved in search, or the searching rules would need to be made more powerful, so, when looking for some file name, it is prepared to consider files that have the file name as a base and use some additional extension, as in your example. I would love to see someone work this out. A proposal would be appreciated. I recently added a hack^H^H^H^Henhancement to zc.resourcelibrary to let you specify a custom directory resource factory to work around this limitation so I could have a dynamically generated js file. Jim -- Jim Fulton Zope Corporation
Jim Fulton wrote:
+1. Some more details would need to be worked out. For example, to work for your use case, it would need to be involved in search, or the searching rules would need to be made more powerful, so, when looking for some file name, it is prepared to consider files that have the file name as a base and use some additional extension, as in your example. I would love to see someone work this out. A proposal would be appreciated.
Sounds about right. There could be two cases, then: 1. A filename has some base extension 2. A filename has some base extension and an additional extension that corresponds to a named adapter, IResourceProvider, deriving from IContentProvider. The default IResourceProvider (registered for '') would simply open the filename and return the contents.
I recently added a hack^H^H^H^Henhancement to zc.resourcelibrary to let you specify a custom directory resource factory to work around this limitation so I could have a dynamically generated js file.
Very useful. I'll look for the changeset. \malthe
Jim Fulton wrote:
+1. Some more details would need to be worked out. For example, to work for your use case, it would need to be involved in search, or the searching rules would need to be made more powerful, so, when looking for some file name, it is prepared to consider files that have the file name as a base and use some additional extension, as in your example. I would love to see someone work this out. A proposal would be appreciated.
I added a proposal here: http://wiki.zope.org/zope3/FileSystemResources \malthe
Thanks for creating this. I just (finally) commented. Jim On Feb 29, 2008, at 6:50 PM, Malthe Borch wrote:
Jim Fulton wrote:
+1. Some more details would need to be worked out. For example, to work for your use case, it would need to be involved in search, or the searching rules would need to be made more powerful, so, when looking for some file name, it is prepared to consider files that have the file name as a base and use some additional extension, as in your example. I would love to see someone work this out. A proposal would be appreciated.
I added a proposal here:
http://wiki.zope.org/zope3/FileSystemResources
\malthe
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
-- Jim Fulton Zope Corporation
participants (2)
-
Jim Fulton -
Malthe Borch