RE: Usurping Directory
Hi again, To customize the display of the directory listing, you should simply override the following methods in Directory: public ListVariant getIndexVariants(ReferenceList indexContent) public Representation getIndexRepresentation(Variant variant, ReferenceList indexContent) Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org/ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com http://www.noelios.com _ De : Cliff Binstock [mailto:[EMAIL PROTECTED] Envoye : samedi 22 novembre 2008 01:37 A : discuss@restlet.tigris.org Objet : RE: Usurping Directory As an upgrade (Restlet request!), looking through the source code it seems that the simplest thing would be if I could insert my own ReferenceList implementation. Perhaps you could have a #setReferenceList option which would take my own (sub-)class. Not only could I change the HREF, but it would be great to put in my own HTML representation anyway, with style, logo, etc. Cliff _ From: Cliff Binstock [mailto:[EMAIL PROTECTED] Sent: Friday, November 21, 2008 2:54 PM To: discuss@restlet.tigris.org Subject: Usurping Directory I would like to modify the standard Directory to return something different than the file when a file is encountered. For example, peruse a directory structure (default behavior), but when you get to the bottom (an actual file), then return a report based on that file, instead of the file itself. It appears that I need a custom DirectoryResource which is attached to a Directory via #setTargetClass. I have the following questions: 1. Setting the target class doesn't seem to be invoking the resource 2. I'm not sure what I would need to override to have custom behavior: #getVariants? 3. Is there a better way to approach the problem? Thanks in advance, Cliff
Usurping Directory
I would like to modify the standard Directory to return something different than the file when a file is encountered. For example, peruse a directory structure (default behavior), but when you get to the bottom (an actual file), then return a report based on that file, instead of the file itself. It appears that I need a custom DirectoryResource which is attached to a Directory via #setTargetClass. I have the following questions: 1. Setting the target class doesn't seem to be invoking the resource 2. I'm not sure what I would need to override to have custom behavior: #getVariants? 3. Is there a better way to approach the problem? Thanks in advance, Cliff
RE: Usurping Directory
As an upgrade (Restlet request!), looking through the source code it seems that the simplest thing would be if I could insert my own ReferenceList implementation. Perhaps you could have a #setReferenceList option which would take my own (sub-)class. Not only could I change the HREF, but it would be great to put in my own HTML representation anyway, with style, logo, etc. Cliff _ From: Cliff Binstock [mailto:[EMAIL PROTECTED] Sent: Friday, November 21, 2008 2:54 PM To: discuss@restlet.tigris.org Subject: Usurping Directory I would like to modify the standard Directory to return something different than the file when a file is encountered. For example, peruse a directory structure (default behavior), but when you get to the bottom (an actual file), then return a report based on that file, instead of the file itself. It appears that I need a custom DirectoryResource which is attached to a Directory via #setTargetClass. I have the following questions: 1. Setting the target class doesn't seem to be invoking the resource 2. I'm not sure what I would need to override to have custom behavior: #getVariants? 3. Is there a better way to approach the problem? Thanks in advance, Cliff