Wednesday, July 20, 2011

Weblog and Theme Association with types [Design Change]

After the review of Dave's excellent feedback i was redesigning the things implemented which would make things easier to develop the mobile rendering infrastructure.Actually those suggestion would become handy when a new type is introduced in the future.You can see the complete midterm feedback here.[1]


WeblogThemeAssoc is added to Roller Business module which will keep track of WeblogTheme and its associated types.This class is persisted through JPA and has the following table.


create table rol_weblogtheme (
    id              varchar(48)  not null primary key,
    weblogid varchar(48) not null,    
    name            varchar(255)  not null,
    custom          $db.BOOLEAN_SQL_TYPE_FALSE not null,
    #columnNotNullWithDefault('type' 'varchar(16)' 'standard')
);


I have added following method to WeblogManager which is implemented in JPAWeblogManagerImpl.
 
public WeblogThemeAssoc getThemeAssoc(Weblog weblog , String type) throws WebloggerException;

public void saveThemeAssoc(WeblogThemeAssoc themeAssoc) throws WebloggerException;


[1] https://cwiki.apache.org/confluence/display/ROLLER/Roller+GSOC+2011+-+mid+term+project+review

Friday, July 8, 2011

Changes In API

In roller weblog for a theme we can get the template using a link.After introducing mobile templates we need to have two templates for a single link such as  <BaseUrl>/page/archive . Therefore following API change was done in Theme.

public List<ThemeTemplate> getTemplatesByLink(String link) throws WebloggerException

This will return list of templates for the given link (Earlier it was single template.) So the templates will be differentiated using their type (mobile , standard)

I have added a method in Page Model to retrieve the StyleSheet of mobile template.So template creators can add the mobile style sheet using following script.

$model.weblog.mobileStylesheet

Friday, July 1, 2011

Changing a mobile Theme template

In Roller we can change the standard theme by navigating to theme page (in settings) and by selecting one of the available ones we need to change into. Similarly in you will be given an option to change the mobile theme through the same page. The changes to the theme selection page will be roughly look as below. (There a few names/description to be updated properly.)