Forum OpenACS Development: RFC for SKIN CHANGER

Collapse
Posted by SriHarsha Chintalapani on
Hi All! I am trying to provide more functionality to skins package, where users can upload their themes and also can change
skin of OACS on the fly.. .

The approach is..

I used the Skin package..which has some kind of standardization in terms of storing the master adp and tcl files in "/packages/skin/master"

folder and all the css and images will go into "/packages/skin/www/"
there are two interfaces i developed one is for upload the theme and another is for two change the theme.


SKIN-UPLOAD INTERFACE:

I provided  a interface for user to upload the skin as ".zip" folder which contains the master adp and tcl files and also the required
css and images along with it a manifest file which describes the theme name and the preview image for that theme and the name of the
masterfile.
for Ex:-
        " <?xml version="1.0"?>
          <theme name="test">
            <masterfile>testtheme</masterfile>
            <thumbnail>preview.jpg</thumbnail>
          </theme> "


The name of the manifest file is standardized that is "skin.info", Because it is much easier to read the file if it is constant over
different themes.By reading the manifest file we get the themename and masterfiles. Based on the themename ill create a directory in
"/skin/www/$theme_name". Then move the masterfiles into /skin/master/.. and all the remaining files (mostly css,images) into
"/skin/www/$theme_name" directory.After moving all the files in their respective directory , the skin has to register with the database
I created a table "themes" where i store theme name and masterfile.


CHANGE-SKIN INTERFACE:

The interface provide a dropdown list of available themes user selects the theme and presses submit button.
Based on the theme_id we can get the theme masterfiles. and we can change the DefaultMaster parameter to point to the new theme.

The interface can be more improved by showing user the preview images.

The above functionality has been developed and it's working fine..!!

But there is  still some standardization in this approach like the user has to provide the master files .adp and .tcl
and also he has to take care in writing the manifest file and it must be present with the  specified name "skin.info".

Could you please suggest better way of doing this  :)
Thank You .