Bonjour Fabien, I am completely ignorant about relational databases external to Zope, but I think that if your database entries can be called with a URL, and can be displayed as html or text, pdf etc, then you can store them in DocumentLibrary. I presume you have a reason to want to do this, such as the really cool facilities offered by DocumentLibrary! Perhaps, like me, you want to mix these data files in with other file types, such as pdfs which you need to index. I have stored nodes of an XML Document, by iterating over them and inserting their attributes into the inputs of a customized document_submit method to give the metadata, and appended a simple render method to the absolute_url of each node to provide the URL to for DocumentLibrary to actually fetch. Sounds complicated, but it took five minutes to input 200 files that way. But I was wondering about something: DocumentLibrary is said to be a cross between a BTree Folder and a ZCatalog. Document Files derive from the Metatype 'File'. I am using DocumentLibrary as a search engine, indexing remote pages and returning results pointing to the page on the remote server (the 'source' property). Thus, once the page is indexed I could delete it (as long as there is no need to reindex). But can I delete the original document and keep only the catalogued 'brain'? Anyone? TIA, Ken
On Monday 07 October 2002 02:56 pm, Ken wrote: [snip]
I am using DocumentLibrary as a search engine, indexing remote pages and returning results pointing to the page on the remote server (the 'source' property). Thus, once the page is indexed I could delete it (as long as there is no need to reindex). But can I delete the original document and keep only the catalogued 'brain'?
Yes and no (depending on how hard you try). Probably the easiest way to do this would be to create a Subclass of DocumentFile that did not store the document data persistently, but fetched in on demand when the object was cataloged, and possibly redirected a browser to the remote URL when the document was accessed. This would not be difficult and would mostly involve overriding the add, edit and PrincipiaSearchSourch methods of DocumentFile. There is already code in there to fetch remote data (using urllib), so that parts already done. You could not get rid of the object entirely though, unless you created a traversal hook in the Documents object which pretended to make it exist. This is probably more trouble then it is worth though. As for using an external database (as was originally asked), I'm not sure why you would want to as most relational databases BLOB support is inefficient, but it could be accomplished in a similar manner, using database queries in place of urllib. -Casey
Anyone?
TIA,
Ken
participants (2)
-
Casey Duncan -
Ken