Looking for Roller? The Official Roller Wiki is now hosted by the Apache Software Foundation.
| Target Release | Roller 3.0 |
| Original Author | AllenGilliland |
| See also | Proposal_NewUrlImplementation |
| Status | Under review |
Redesign Roller's url structure to provide a consolidated url space per weblog and alleviate some technical limitations of the current url structure.
Roller's current url structure has a variety of technical limitations and does not support a well defined url space per weblog. Urls are spread out somewhat erratically accross the application url space and the current design makes it difficult to add new features to the urls. In order to improve upon these issues we need to start from the ground up and redesign the url structure.
This is page 1 of a 2 page proposal. This first page will cover the general approach to redesigning the url structure and will propose how the new urls will look. The second proposal will provide more technical details about how the implementation will happen.
Related JIRA issues:
: Better URLs
How it will work:
The Theory:
the main point of this structure is to 1) provide an individual url space per weblog and 2) make sure that we maintain flexible control over that url space. the key is that we maintain proper control over the <ctx> portion of the url because it ensures that we can continue to add on to the url structure in the future without running into problems where the url space is constrained. we want to avoid variable or user defined data from being used at the <ctx> level of the url.
Basic Url Overview:
Language Support (<lang> is a 5 char locale identifier like "ja_JP"):
Language is optional. only a small percentage of the blogs on most sites will want to maintain their blog in multiple languages, so we don't want to force a language identifier in all urls. if a language identifier exists in the url it will always restrict the view to only entries/content published in that language.
Choosing a default language. users will be allowed to choose a default language for their weblog which will be used for all urls that don't include a language identifier in the url. users may also choose to include all languages in their default view if they don't plan to use any language specific urls.
Entry Collection views:
for the main types of collections (date based, category, and tags) we will offer a nice path based url. these path based urls will NOT allow constraint by additional criteria and will only support a limited number of additional query parameters for things like paging.
the main page of the blog will serve a collection of entries constrained by any number of criteria specified by query params. these urls will not be promoted as widely in the software since they shouldn't be needed too often, but they will be available.
Permalinks and posting comment and trackback data:
post data to permalink urls. the first benefit is that we aren't required to maintain a whole new url like /<weblog>/comment/<anchor> just for posting data, so it keeps our url space trimmed. secondly, it just makes sense because people POST comments/trackbacks to entries.
Feed Urls:
this is for any content feeds that are available. currently we have rss, rss091, rss092, and atom. we expect comment feeds to be a likely addition in the near future.
User Defined Pages:
this section is for any special pages that the user wants to make out of their templates. a good example would be a css or js file to use in their weblog. custom pages will have access to any query parameters appended to the url in their templates, and no path based extensions will be allowed.
User Uploaded Resources:
this works just as it does now, serving up any static files uploaded by the user.
Search Results:
Tags Support:
There are many reasons to do this, but the most important reason is that in order to successfully transition to the new url structure we need to EOL the old urls and redirect them. This is important because if the old urls continue to work then they will continue to be used, which is not ideal.
In order to ensure that we can continue to add/remove/modify any of Roller's servlets without affecting the overall url space for an installation we will plan to move all servlets under a single root url path like /roller-servlets/*. These servlets will be hidden away and not meant for direct access. For example we might have ...
This same approach would apply for the Roller editor/admin interface as well. We would like to move away from the current urls of /editor/* and /admin/* and migrate to a consolidated url space for the entire interface. Something like /roller-UI/* would be appropriate.
After all of the old servlets have been properly moved to their new locations we will have to provide redirect service for the old urls. All old urls will get a 301 Permanently Moved http redirect response pointing it to the new url.
these are just some items that require a little discussion and group decision.
Add comments here.
SeanGilligan: Looks really good, Allen! I'm still interested in completing the Spring MVC proposal (long couple of days ... huh?). I have written some code just to validate things for myself, but I haven't tested it yet -- having the URL structure will help with that. I truly believe it will help with URL migration and general flexibility/customization. One of the benefits of using Spring MVC controllers is that you have a lot greater flexibility in URL mapping. Spring MVC uses a dispatcher servlet and a set of controllers. I will propose refactoring all/most/many of the servlets into controllers, but you can have the Spring MVC dispatcher map URLs to existing servlets. Now that we have a proposed URL structure, I'll look at doing it with the built in SimpleUrlHandlerMapping
, but the option of writing a custom mapping is there if necessary.
SeanGilligan: Is there a written description of <anchor>, <flavor>, <page link> somewhere that we can link to?
SeanGilligan: I'm not sure if browser language settings should be used to *filter* out entries, that could be confusing to some users. I think they should only be used if an entry is available in multiple formats. In other words, browser settings could be used to select among languages for a permalink, but should not be used to filter out entries in a search URL.
SeanGilligan: Is it worthwhile to consider reserving URLs or defining a recommended mechanism for adding URLs from plugins or extensions? For example, I've thought about creating a capability for users to create a set of named feeds that they can create via a web gui and can enumerate in a velocimacro (or blog tag) - how would these be mapped into the URL space?
DaveJohnson: It may be a bad practice to offer both RSS and Atom feeds of the very same content. Perhaps we should offer only Atom 1.0 feeds. Atom is an well specified IETF standard and all parser libraries and aggregators support it.
AnilGangolli: I don't see any <ctx> space under which combining date and tag or category restrictions is possible. (Why not?)