You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@roller.apache.org by Dave Johnson <sn...@gmail.com> on 2006/06/05 20:21:30 UTC

Atlas frontpage: how to specify page models for a blog?

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?

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.

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

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

I'm leaning towards option #3. Any comments or suggestions or other options?

- Dave

Re: Atlas frontpage: how to specify page models for a blog?

Posted by Anil Gangolli <an...@busybuddha.org>.
Alternatively, have static configuration determine the page model names and 
class correspondence.

----- Original Message ----- 
From: "Allen Gilliland" <al...@sun.com>
To: <ro...@incubator.apache.org>
Sent: Monday, June 05, 2006 12:04 PM
Subject: Re: Atlas frontpage: how to specify page models for a blog?


>
>
> Dave Johnson wrote:
>> On 6/5/06, Allen Gilliland <al...@sun.com> wrote:
>>> 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.
>>
>> We've got to get the model names from somewhere, so what you're
>> suggesting is a new option. I'll call it option #5:
>>
>> Option #5: 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 classname to be instantiatedfor the model.
>>
>>   <model 1 class>
>>   <model 2 class>
>>   <model 3 class>
>>
>> Each model must implement  an PageModel interface with a getName()
>> method so we can detrermine what name to use in the Velocity context.
>
> yep, that sounds good to me.  maybe the method name should be 
> getModelName() to make sure we identify what the name is describing.
>
> -- Allen
>
>
>>
>> - Dave
> 


Re: Atlas frontpage: how to specify page models for a blog?

Posted by Allen Gilliland <al...@sun.com>.

Dave Johnson wrote:
> On 6/5/06, Allen Gilliland <al...@sun.com> wrote:
>> 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.
> 
> We've got to get the model names from somewhere, so what you're
> suggesting is a new option. I'll call it option #5:
> 
> Option #5: 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 classname to be instantiatedfor the model.
> 
>   <model 1 class>
>   <model 2 class>
>   <model 3 class>
> 
> Each model must implement  an PageModel interface with a getName()
> method so we can detrermine what name to use in the Velocity context.

yep, that sounds good to me.  maybe the method name should be 
getModelName() to make sure we identify what the name is describing.

-- Allen


> 
> - Dave

Re: Atlas frontpage: how to specify page models for a blog?

Posted by Dave Johnson <sn...@gmail.com>.
On 6/5/06, Allen Gilliland <al...@sun.com> wrote:
> 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.

We've got to get the model names from somewhere, so what you're
suggesting is a new option. I'll call it option #5:

Option #5: 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 classname to be instantiatedfor the model.

   <model 1 class>
   <model 2 class>
   <model 3 class>

Each model must implement  an PageModel interface with a getName()
method so we can detrermine what name to use in the Velocity context.

- Dave

Re: Atlas frontpage: how to specify page models for a blog?

Posted by Allen Gilliland <al...@sun.com>.
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