comments inline ...
Dave Johnson wrote:
This issue is regarding the Atlas frontpage proposal:
http://rollerweblogger.org/wiki/Wiki.jsp?page=Proposal_Atlas
Currently, within weblog templates, you can access the page model, an
object of
type org.apache.roller.velocity.PageModel, via the Velocity expression
$pageModel. But with the new Atlas frontpage, we're introducing a couple of
new page models which will be made available to some but not all weblogs.
There's the new SitePageModel, which provides access to site-wide data, and
there's the new PlanetPageModel, which represents data from the planet
aggregator.
The question is: how do we configure which models are available to which
blogs.
Here are the options I've come up with so far:
Option #1: allow all blogs to access the page models via the names
$sitePageModel and $planetPageModel. Why not allow all blogs to display
site-wide and planet data?
i don't think we can do that. there are definitely going to be people
who don't want all weblogs to have access to all page models.
Option #2: only make SitePageModel and PlanetPageModel available to the one
blog that is designated to be the front page blog via the names
$sitePageModel
and $planetPageModel.
fine, but it's not very flexible :(
Option #3: Add a new field to the website table called page_models,
which is
editable only by Global Admins. The new field will list the additional page
models to be available to a blog in a simple format. For each model, we
list
the name to be used in Velocity and the classname to be instantiated
for the model.
<model 1 name>, <model 1 class>
<model 2 name>, <model 2 class>
<model 3 name>, <model 3 class>
So, for example a front page blog would have this value:
sitePageModel,org.apache.roller.velocity.SitePageModel
planetPageModel,org.apache.roller.velocity.PlanetPageModel
this seems like the best mix of flexible and reasonably easy to use. my
one big suggestion here is that we not allow the admins to choose the
names for the models. i think that will only confuse people and create
a support nightmare, lets just standardize the names like you have in #1
and #2. this way the list of models is easier because it's just a list
of classnames.
Option #4: Introduce a roller_pagemodel table and a one-to-many
association from
website to roller_pagemodel that allows us to associate an abtritrary
number of
page models with a website. Also introduce a UI for allowing a global
admin to
associate page models with websites.
Table: roller_pagemodel
id
website_id
modelname
classname
this is maybe a bit cleaner than #3, but it seems a little overboard to
me. i don't see any reason to do this and add another join on the
website table just to manage page models.
-- Allen
I'm leaning towards option #3. Any comments or suggestions or other
options?
- Dave