On Tuesday 27 May 2003 04:09 pm, Jaco de Groot wrote:
> Peter Reitsma wrote:
> > Has anybody faced this problem before and some solutions, best practices,
> > suggestions or hints ?
>
> A filter works fine in this case.
Yes I think a filter can be used, but  I think struts might be a better 
choices here because the view (read generic template) are not bound to URLs( 
read semantic)

I think the hard bit doesn't really lay in the front servlet/struts , it is 
creating a mapping between a tree and a web structure (MMBase cloud) and a 
reverse mapping item(read node) to tree that is difficult

the simplest way in your case is to use something like jumper (so just a list 
of "old URLs" and new "URLs"). but in that case you will lose the nice URLs 
and your breadcrum.

If that doesn't suite your needs and you want to keep working in a hyrachical 
manner you can choose to approaches

categorizing you content with categories(recursive)/content 
or give it a more meaning full structure
kennisnet/onderwijstype/onderwijs/nieuws

(both are possible, the last one is less generic and thus easier to make, but 
i prefer the upper one that is more generic)

after you have categorized your content you need to decide if your site 
structure will be the same as your content structure and to what extend.

for example some sites only use the category structure to define "where am i"
and use extra parameters to define "what do i need to show". thats probably 
why in your example multiple parameters are used
sector=2&cat=12342&article=23423412
this is what I call "the single JSP page site"

other sites use JSP pages to define "what am i seeing"
/elements/news.jsp?item=123.
In those site you see that you often lose you navigation and start spinning 
the web of mmbase

I am shure there a more trics

Butl when you are a item level and you start creating relations to other type 
of content (say an article with related articles) you need to decide if you 
are relating to an item (/elements/news.jsp?item123) or to an item in a 
category
(index.jsp?sector=2&cat=12342&item=123). if yout choose the last one you need 
to know where in your structure the item is placed in order to generate the 
desired url

so far so good?

OK now you have your structure and you want to relate 2 categories to each 
other. At that point you are starting to loose you hyrachical structure
that's why you create a new type of relation between categories. one that 
defines that 2 categories are related but don't have a parent child relation.
The tree structures that defines your site can't match your web structure 
anymore) that not nececarly bad I just tells that the tree is only a view of 
the web structure and that there is now magic formula to convert a tree to a 
web and vice versa.

the bottom line.. category/content structure should not be your navigation 
structure.
so your need to split the navigation and the categories / content.
there are many way's of doing that i have tried 2 in the past
kenniswijk/wiab I:
-for every content/category create a "view" and on the web-site use the view 
number to display the content ( that's a lot of work . but it works, thanks 
to virtual web masters)

-wiab II
generate a XML site tree based on the category structure. for every element 
create a pointer to a category. store the xml in a "navigation" node and 
write some util classes to show the breadcrum etc.

additionally and finally ... (your initial question and not present in wiab) 
write the servlet/struts that as input gets the navigation 
(/home/onderwijs/test/test/mooi.html)
and maps that to "generic JSPS". the generic jsp should then use the 
navigation XML if they want to create new URLs.

Im quite sure that this doens't really answers your question. but hopefully it 
wil prevent you from reinventing the wheel.




Reply via email to