kinyelo / vosao

Automatically exported from code.google.com/p/vosao
GNU Lesser General Public License v2.1
1 stars 2 forks source link

Add support for REST style page URLs #379

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
(1) Allow RESTful URLs with parameters, like 

www.domain.com/parent/child/california/los%20angeles 

where the friendly URL might be www.domain.com/parent/child/* 

(2) Merge RESTful parameters into a page, such as 

${vosao.restParam(2)}, ${vosao.restParam(1)}  Roofing Estimates 

Get Quotes from Roofing Companies in ${vosao.restParam(2)}, 
${vosao.restParam(1)} & Surrounding Areas 

so that /child/California/Los%20Angeles 

would open /child and render 

Los Angeles, California  Roofing Estimates 

Get Quotes from Roofing Companies in Los Angeles, California & Surrounding 
Areas 

-Ted. 

Things to be implemented:

1. Support friendly URLs having "/*" at the end for RESTful URLs. For example 

/my/page/*

2. Add method getRestParam(int index) to the VosaoTool available in Velocity 
templates as $vosao for getting RESTful parameters starting with 1 index.

-Alex.

Original issue reported on code.google.com by kinyelo@gmail.com on 26 Nov 2010 at 9:05

GoogleCodeExporter commented 9 years ago
As a result of it's nature rest pages can't have children because they will be 
shadowed by rest parameters.

Original comment by kinyelo@gmail.com on 26 Nov 2010 at 9:14

GoogleCodeExporter commented 9 years ago
Better way for setting page Restfull type would be additional field in 
PageEntity and standard URL usage. (for search performance reasons)

Doing search from the end of URL will allow to have children pages working 
properly.

Original comment by kinyelo@gmail.com on 26 Nov 2010 at 9:38

GoogleCodeExporter commented 9 years ago
Implemented. 

Example of getting rest parameters:

page - /test
url -  /test/alex/roma

In the Velocity:
$vosao.getRestParam(1) -> alex
$vosao.getRestParam(2) -> roma
$vosao.getRestParam(3) -> Java null

Original comment by kinyelo@gmail.com on 26 Nov 2010 at 10:15

GoogleCodeExporter commented 9 years ago
Wow, that looks great, Alex. 

For completeness, do we want to include a getParam(string) to retrieve 
conventional URL parameters by name? ($vosao.getParam('city'))

-Ted.

Original comment by ted.husted on 27 Nov 2010 at 2:08

GoogleCodeExporter commented 9 years ago
Actually we can access request parameters by 
$request.getParameter("param_name"). I don't think we need to create alias 
$vosao.getParam("param_name")

Original comment by kinyelo@gmail.com on 28 Nov 2010 at 11:51

GoogleCodeExporter commented 9 years ago
I listed all the other context objects/tools from
PageBusinessImpl.createContext, .addVelocityTools and .render, as TODO
items.

 * http://staging.vosao.org/designer/doc/templates

Does that sound like the exhaustive list of context objects/tools
exposed by the core framework?

Are our plugins exposing any objects of their own (yet)?

-Ted.

Original comment by ted.husted on 28 Nov 2010 at 2:25