[Yanel-dev] Re: Default mapping of Yanel

Michael Wechner michael.wechner at wyona.com
Mon Nov 29 15:22:06 CET 2010


Hi Balz

On 11/29/10 1:15 PM, Balz Schreier wrote:
> Hi Michi,
>
> I have now found on line 139 in the ResourceManager.java class the =

> following:
>
> // Fallback to file/node resource
>
> return getResource(environment, realm, path, new =

> ResourceConfiguration("file", =

> "http://www.wyona.org/yanel/resource/1.0", null));
>
>
> So this means, if there is no mapping found, it tries to process the =

> URL with the File Resource which in turn returns an XML of the whole =

> structure.

right, whereas the class

src/impl/java/org/wyona/yarep/impl/repo/vfs/VirtualFileSystemNode.java

returns then the directory listing by the method

public String getDirectoryListing(File file, String mimeType) {

> We have noticed that many robots out there try to go up the hierarchy =

> of a URL (e.g. /images/small/take.jpg --> they try to access =

> /images/small and also /images).
>
> I think that Yanel should not have this behaviour per default.

because of backwards compatibility we have to make this the default

> Of course it could be an option in order to enable it as it can be =

> convenient in certain cases.
>
> What do you think?

I agree that this should be configurable, whereas we need to discuss =

what exactly shall happen if the default is turned off:

- Shall there be an "ugly" Yanel exception

- Shall be there a "warning" screen telling people that they need to add =

something like below?

Also please note that within your resource-config map you can always set =

something like:

<matcher pattern=3D"**" rcpath=3D"/no-matcher-found_yanel-rc.xml"/>

Cheers

Michael
>
> Cheers
> Balz
>
> On Mon, Nov 29, 2010 at 1:55 PM, Balz Schreier =

> <balz.schreier at gmail.com <mailto:balz.schreier at gmail.com>> wrote:
>
>     Hi,
>
>     I noticed the following:
>
>     - if you enter a URL that does not match to any pattern configured
>     in the map.rc-map file, usually you get the 404 page (which I
>     expect for ALL URLs that do not match).
>     - I know noticed that if the path (e.g. /internal) matches an
>     actual directory on the physical harddrive (e.g. ROOT/internal
>     where ROOT is the root of the data repository), Yanel returns an
>     XML with all the subdirectories in that folder.
>
>     Is this normal ?
>     How can I disable this behaviour so that 404 is returned?
>
>     Cheers
>     Balz
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wyona.org/pipermail/yanel-development/attachments/2010112=
9/8b06fc8a/attachment.htm


More information about the Yanel-development mailing list