Hi, I'd like to display folders and files in a LocalFS object as a list of links (NOT using the default display method form LocalFS), where I can click on a folder to see more files, or click on a file and have it displayed. Files will be either html or pdf files. I also want to use a dtml method called index_html to display this. Here's the usual way I do this with standard Zope objects: <dtml-var standard_html_header> <ul> <dtml-in expr="objectValues(['Folder', 'File'])"> <li><a href="&dtml-absolute_url;"><dtml-var title_or_id></a></li> </dtml-in> </ul> <dtml-var standard_html_footer> How do I enhance this to "also" work with LocalFS objects that will be nested inside regular Zope folders? I see that in LocalFS objectValues become fileValues, and I can get them to be listed, but I can't seem to turn that into a list of hyperlinks. A code snippet from someone who is doing this would be great! We will be uploading lots of files via ftp to the Zope server. We briefly looked at ExtFile, and like the idea, but didn't see how to create an ExtFile object via ftp upload. A remote server will create a file and automatically via cron ftp it to the Zope server to the local filesystem to be used via LocalFS. Is there a way to do this with ExtFile without human intervention? ;-) Of course, I have to do this in a hurry so I'm probably reading right past the obvious answer in the docs. I just can't seem to put it together this morning ;-) Thanks, Mark
How do I enhance this to "also" work with LocalFS objects that will be nested inside regular Zope folders? I see that in LocalFS objectValues become fileValues, and I can get them to be listed, but I can't seem to turn that into a list of hyperlinks. A code snippet from someone who is doing this would be great!
I guess looking into the LocalFS source code will do. LocalFS has clickable links on the contents and the edit (index_html) screen. Just look at the DTML for that.
We will be uploading lots of files via ftp to the Zope server. We briefly looked at ExtFile, and like the idea, but didn't see how to create an ExtFile object via ftp upload. A remote server will create a file and automatically via cron ftp it to the Zope server to the local filesystem to be used via LocalFS. Is there a way to do this with ExtFile without human intervention? ;-)
The ftp/LocalFS way will certainly work (though it is not too secure; SCP would be better). But I'd prefer a more elegant way, using XML-RPC to create files directly in Zope. If your objects are VERY large however, ftp will work better. Joachim
Thanks Joachim. I'm not in the office at the moment so I'll look at the source when I get in (about 45 minutes). We are hoping to restrict displaying individual links based on roles and properties, etc. I'm not sure yet if LocalFS will support that. (If user has role "A" then only display "A" report files. If user has role "B" then also display "A and B" reports). We may need to create separate LocalFS objects based on access requirements. That's why we are looking to do this outside of methods provided by LocalFS - to keep that free of edits for easier product updates. Although, I suppose we could override the method by creating our own copy with our edits.... Thanks, Mark Joachim Werner wrote:
How do I enhance this to "also" work with LocalFS objects that will be nested inside regular Zope folders? I see that in LocalFS objectValues become fileValues, and I can get them to be listed, but I can't seem to turn that into a list of hyperlinks. A code snippet from someone who is doing this would be great!
I guess looking into the LocalFS source code will do. LocalFS has clickable links on the contents and the edit (index_html) screen. Just look at the DTML for that.
We will be uploading lots of files via ftp to the Zope server. We briefly looked at ExtFile, and like the idea, but didn't see how to create an ExtFile object via ftp upload. A remote server will create a file and automatically via cron ftp it to the Zope server to the local filesystem to be used via LocalFS. Is there a way to do this with ExtFile without human intervention? ;-)
The ftp/LocalFS way will certainly work (though it is not too secure; SCP would be better). But I'd prefer a more elegant way, using XML-RPC to create files directly in Zope. If your objects are VERY large however, ftp will work better.
Joachim
participants (2)
-
Joachim Werner -
Mark Langkau