URL handling

View: New views
7 Messages — Rating Filter:   Alert me  

URL handling

by Christian Steinert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear all

one of the things that I am unhappy with in opencms is that there is no
abstraction between URLs and file system resources.

Has anybody in a project implemented some mapping between logical and
physical URLs? If so, which technique did you use? Servlet filters?

Did anybody successfully implement in a custom 404-handler in opencms?
Maybe even in a way that works with static export? I am not looking for
code here, I only try to figure out, how I could create a custom mapping
of URLs against cms resources, without touching the CMS core and without
messing around with external things like mod_rewrite.

One thing that would already be a huge improvement is, if resources
could be addressed like folders, as it is possible in Apache. For
example, if I have a JSP resource called /foo/bar  and if a request is
issued for /foo/bar/baz,then it would be incredibly helpful, if actually
/foo/bar were called. This would very easily allow to create mappers for
custom url spaces. Does anybody else think this is a good idea? At least
the request handling and the link management of opencms would be
affected by this, I think. Also, I don't know how expensive this would
become, since a naive traversal of the filesystem, whenever a resource
is not found might cause too much DB activity.

Nonetheless, I wanted to ask, what others think of this.

Kind regards
Christian

_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev

Re: URL handling

by Achim Westermann-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Christian,

personally I don't like this. What happens is that your editors (and
developers new to the team) will end up searching the file / jsp in VFS
they are seeing in the browser if they want/have to change something. I
would not fiddle around with this.
However you are free to do it. I'd think of a mod_rewrite in apache.

kind regards,

Achim


Christian Steinert wrote:

> Dear all
>
> one of the things that I am unhappy with in opencms is that there is no
> abstraction between URLs and file system resources.
>
> Has anybody in a project implemented some mapping between logical and
> physical URLs? If so, which technique did you use? Servlet filters?
>
> Did anybody successfully implement in a custom 404-handler in opencms?
> Maybe even in a way that works with static export? I am not looking for
> code here, I only try to figure out, how I could create a custom mapping
> of URLs against cms resources, without touching the CMS core and without
> messing around with external things like mod_rewrite.
>
> One thing that would already be a huge improvement is, if resources
> could be addressed like folders, as it is possible in Apache. For
> example, if I have a JSP resource called /foo/bar  and if a request is
> issued for /foo/bar/baz,then it would be incredibly helpful, if actually
> /foo/bar were called. This would very easily allow to create mappers for
> custom url spaces. Does anybody else think this is a good idea? At least
> the request handling and the link management of opencms would be
> affected by this, I think. Also, I don't know how expensive this would
> become, since a naive traversal of the filesystem, whenever a resource
> is not found might cause too much DB activity.
>
> Nonetheless, I wanted to ask, what others think of this.
>
> Kind regards
> Christian
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>

_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev

Re: URL handling

by Yves Glodt-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



2009/10/18 Christian Steinert <christian_steinert@...>
Dear all

one of the things that I am unhappy with in opencms is that there is no
abstraction between URLs and file system resources.

Has anybody in a project implemented some mapping between logical and
physical URLs? If so, which technique did you use? Servlet filters?

Not sure if it corrensponds 100% to your request, but I have used URLrewrite to mess with urls.
(mainly to remove the /opencms prefix, because I wanted to avoid using Apache httpd in my setup)

Read more about here:
http://opencms-wiki.org/Removing_the_/opencms/opencms_prefix_without_using_Apache
 

Did anybody successfully implement in a custom 404-handler in opencms?
Maybe even in a way that works with static export? I am not looking for
code here, I only try to figure out, how I could create a custom mapping
of URLs against cms resources, without touching the CMS core and without
messing around with external things like mod_rewrite.

One thing that would already be a huge improvement is, if resources
could be addressed like folders, as it is possible in Apache. For
example, if I have a JSP resource called /foo/bar  and if a request is
issued for /foo/bar/baz,then it would be incredibly helpful, if actually
/foo/bar were called. This would very easily allow to create mappers for
custom url spaces. Does anybody else think this is a good idea? At least
the request handling and the link management of opencms would be
affected by this, I think. Also, I don't know how expensive this would
become, since a naive traversal of the filesystem, whenever a resource
is not found might cause too much DB activity.

Nonetheless, I wanted to ask, what others think of this.

Kind regards
Christian

_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev



_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev

Re: URL handling

by ] Code Create [ Bernd Wolfsegger :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Christian,

Regarding 404 and 500 errors (and if you like some more) have a look here:

http://www.code-create.de/somefilethatdowesnotexist.html

All you need is already there in OpenCms.
Have a look at the /workplace/handler folder.
There you have to customize the handle404.html and handle500.html to your needs.
You can than e.g. use an included structured content and a related jsp (as usual
with structured content) to display fully configurable error pages.
For the 500er you have to change the corresponding entry in the web.xml so that
it looks like the one for the 404.

Hope that helps.

Kind regards, Bernd



-----Ursprüngliche Nachricht-----
Von: opencms-dev-bounces@... [mailto:opencms-dev-bounces@...] Im
Auftrag von Christian Steinert
Gesendet: Sonntag, 18. Oktober 2009 12:03
An: The OpenCms mailing list
Betreff: [opencms-dev] URL handling

Dear all

one of the things that I am unhappy with in opencms is that there is no
abstraction between URLs and file system resources.

Has anybody in a project implemented some mapping between logical and
physical URLs? If so, which technique did you use? Servlet filters?

Did anybody successfully implement in a custom 404-handler in opencms?
Maybe even in a way that works with static export? I am not looking for
code here, I only try to figure out, how I could create a custom mapping
of URLs against cms resources, without touching the CMS core and without
messing around with external things like mod_rewrite.

One thing that would already be a huge improvement is, if resources
could be addressed like folders, as it is possible in Apache. For
example, if I have a JSP resource called /foo/bar  and if a request is
issued for /foo/bar/baz,then it would be incredibly helpful, if actually
/foo/bar were called. This would very easily allow to create mappers for
custom url spaces. Does anybody else think this is a good idea? At least
the request handling and the link management of opencms would be
affected by this, I think. Also, I don't know how expensive this would
become, since a naive traversal of the filesystem, whenever a resource
is not found might cause too much DB activity.

Nonetheless, I wanted to ask, what others think of this.

Kind regards
Christian

_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev


_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev

Re: URL handling

by Michael Moossen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Christian!

For mapping URLs to Resources you can use a Resource init handler.
For an example, see org.opencms.main.CmsPermalinkResourceHandler

HTH
-------------------
Michael Moossen

Alkacon Software GmbH  - The OpenCms Experts
http://www.alkacon.com - http://www.opencms.org

Christian Steinert schrieb:

> Dear all
>
> one of the things that I am unhappy with in opencms is that there is no
> abstraction between URLs and file system resources.
>
> Has anybody in a project implemented some mapping between logical and
> physical URLs? If so, which technique did you use? Servlet filters?
>
> Did anybody successfully implement in a custom 404-handler in opencms?
> Maybe even in a way that works with static export? I am not looking for
> code here, I only try to figure out, how I could create a custom mapping
> of URLs against cms resources, without touching the CMS core and without
> messing around with external things like mod_rewrite.
>
> One thing that would already be a huge improvement is, if resources
> could be addressed like folders, as it is possible in Apache. For
> example, if I have a JSP resource called /foo/bar  and if a request is
> issued for /foo/bar/baz,then it would be incredibly helpful, if actually
> /foo/bar were called. This would very easily allow to create mappers for
> custom url spaces. Does anybody else think this is a good idea? At least
> the request handling and the link management of opencms would be
> affected by this, I think. Also, I don't know how expensive this would
> become, since a naive traversal of the filesystem, whenever a resource
> is not found might cause too much DB activity.
>
> Nonetheless, I wanted to ask, what others think of this.
>
> Kind regards
> Christian
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev

_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev

Re: URL handling

by Christian Steinert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

] Code Create [ Bernd Wolfsegger wrote:

> Hi Christian,
>
> Regarding 404 and 500 errors (and if you like some more) have a look here:
>
> http://www.code-create.de/somefilethatdowesnotexist.html
>
> All you need is already there in OpenCms.
> Have a look at the /workplace/handler folder.
> There you have to customize the handle404.html and handle500.html to your needs.
> You can than e.g. use an included structured content and a related jsp (as usual
> with structured content) to display fully configurable error pages.
> For the 500er you have to change the corresponding entry in the web.xml so that
> it looks like the one for the 404.
>
> Hope that helps.
>  
Yes - that helps :-)
thanks a lot.

Christian

> Kind regards, Bernd
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: opencms-dev-bounces@... [mailto:opencms-dev-bounces@...] Im
> Auftrag von Christian Steinert
> Gesendet: Sonntag, 18. Oktober 2009 12:03
> An: The OpenCms mailing list
> Betreff: [opencms-dev] URL handling
>
> Dear all
>
> one of the things that I am unhappy with in opencms is that there is no
> abstraction between URLs and file system resources.
>
> Has anybody in a project implemented some mapping between logical and
> physical URLs? If so, which technique did you use? Servlet filters?
>
> Did anybody successfully implement in a custom 404-handler in opencms?
> Maybe even in a way that works with static export? I am not looking for
> code here, I only try to figure out, how I could create a custom mapping
> of URLs against cms resources, without touching the CMS core and without
> messing around with external things like mod_rewrite.
>
> One thing that would already be a huge improvement is, if resources
> could be addressed like folders, as it is possible in Apache. For
> example, if I have a JSP resource called /foo/bar  and if a request is
> issued for /foo/bar/baz,then it would be incredibly helpful, if actually
> /foo/bar were called. This would very easily allow to create mappers for
> custom url spaces. Does anybody else think this is a good idea? At least
> the request handling and the link management of opencms would be
> affected by this, I think. Also, I don't know how expensive this would
> become, since a naive traversal of the filesystem, whenever a resource
> is not found might cause too much DB activity.
>
> Nonetheless, I wanted to ask, what others think of this.
>
> Kind regards
> Christian
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>
>  


_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev

Re: URL handling

by Christian Steinert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Christian!

For mapping URLs to Resources you can use a Resource init handler.
For an example, see org.opencms.main.CmsPermalinkResourceHandler
  
Dear Michael

Thank you very much - this looks  extremely interesting.

For all: in opencms-system.xml, there are several resource handlers that are predefined with the possibility to configure additional handlers. A resource init handler is a class that responsible for mapping a requested URL to a resource in opencms. All handlers are called in sequence, which means that an additional URL scheme can be added without affecting existing functionality.

This looks very simple to use and quite elegant. I like this a lot.
This is exactly what I was looking for.

thanks and regards
Christian
HTH
-------------------
Michael Moossen

Alkacon Software GmbH  - The OpenCms Experts
http://www.alkacon.com - http://www.opencms.org

Christian Steinert schrieb:
  
Dear all

one of the things that I am unhappy with in opencms is that there is no 
abstraction between URLs and file system resources.

Has anybody in a project implemented some mapping between logical and 
physical URLs? If so, which technique did you use? Servlet filters?

Did anybody successfully implement in a custom 404-handler in opencms? 
Maybe even in a way that works with static export? I am not looking for 
code here, I only try to figure out, how I could create a custom mapping 
of URLs against cms resources, without touching the CMS core and without 
messing around with external things like mod_rewrite.

One thing that would already be a huge improvement is, if resources 
could be addressed like folders, as it is possible in Apache. For 
example, if I have a JSP resource called /foo/bar  and if a request is 
issued for /foo/bar/baz,then it would be incredibly helpful, if actually 
/foo/bar were called. This would very easily allow to create mappers for 
custom url spaces. Does anybody else think this is a good idea? At least 
the request handling and the link management of opencms would be 
affected by this, I think. Also, I don't know how expensive this would 
become, since a naive traversal of the filesystem, whenever a resource 
is not found might cause too much DB activity.

Nonetheless, I wanted to ask, what others think of this.

Kind regards
Christian

_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev
    

_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev

  



_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev