Package com.appenginecart.controller

Source Code of com.appenginecart.controller.AppController

package com.appenginecart.controller;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;
import com.appenginecart.system.AppConfig;

public class AppController extends Controller {
   
    private AppConfig appConfig = null;
    private String theme = "default";
    private String themePath = "";
   
   
    @Override
    protected Navigation setUp() {
        try {
            loadConfig();
           
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return null;
    }
   
    @Override
    public Navigation run() throws Exception {
        return null;
    }
   
    protected void loadConfig() throws Exception{
        appConfig = new AppConfig("appenginecart.properties");
        setTheme(appConfig.getValue("appenginecart.config.theme"));
        setThemePath(String.format("theme/%s/pages/", getTheme()));
    }

    public String getTheme() {
        return theme;
    }

    public void setTheme(String theme) {
        this.theme = theme;
    }

    public String getThemePath() {
        return themePath;
    }

    public void setThemePath(String themePath) {
        this.themePath = themePath;
    }

    public String themePage(String page) {
        return String.format("%s%s", getThemePath(), page);
    }
   
}
TOP

Related Classes of com.appenginecart.controller.AppController

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.