Package org.apache.roller.weblogger.business.themes

Examples of org.apache.roller.weblogger.business.themes.SharedTheme


           
            // only continue if custom themes are allowed
            if(WebloggerRuntimeConfig.getBooleanProperty("themes.customtheme.allowed")) {
               
                // do theme import if necessary
                SharedTheme importTheme = null;
                if(isImportTheme() && !StringUtils.isEmpty(getImportThemeId())) try {
                    ThemeManager themeMgr = WebloggerFactory.getWeblogger().getThemeManager();
                    importTheme = themeMgr.getTheme(getImportThemeId());
                    themeMgr.importTheme(getActionWeblog(), importTheme);
                } catch(WebloggerException re) {
                    log.error("Error customizing theme for weblog - "+getActionWeblog().getHandle(), re);
                    // TODO: i18n
                    addError("Error importing theme");
                }
               
                if(!hasActionErrors()) try {
                    weblog.setEditorTheme(WeblogTheme.CUSTOM);
                    log.debug("Saving custom theme for weblog "+weblog.getHandle());
                   
                    // save updated weblog and flush
                    UserManager userMgr = WebloggerFactory.getWeblogger().getUserManager();
                    userMgr.saveWebsite(weblog);
                    WebloggerFactory.getWeblogger().flush();
                   
                    // make sure to flush the page cache so ppl can see the change
                    CacheManager.invalidate(weblog);
                   
                    // TODO: i18n
                    addMessage("Successfully set theme to - "+WeblogTheme.CUSTOM);
                    if(importTheme != null) {
                        addMessage("Successfully copied templates from theme - "+importTheme.getName());
                    }
                   
                    // reset import theme options
                    setImportTheme(false);
                    setImportThemeId(null);
View Full Code Here


        String previewImagePath = null;
       
        // try looking up selected theme
        try {
            ThemeManager tmgr = WebloggerFactory.getWeblogger().getThemeManager();
            SharedTheme previewTheme = tmgr.getTheme(theme);
            ThemeResource previewImage = previewTheme.getPreviewImage();
            if(previewImage != null) {
                previewImagePath = previewImage.getPath();
                resourceLastMod = previewImage.getLastModified();
                resourceStream = previewImage.getInputStream();
            }
View Full Code Here

           
            // only continue if custom themes are allowed
            if(WebloggerRuntimeConfig.getBooleanProperty("themes.customtheme.allowed")) {
               
                // do theme import if necessary
                SharedTheme t = null;
                if(isImportTheme() && !StringUtils.isEmpty(getImportThemeId())) try {
                    ThemeManager themeMgr = WebloggerFactory.getWeblogger().getThemeManager();
                    t = themeMgr.getTheme(getImportThemeId());
                    themeMgr.importTheme(getActionWeblog(), t);
                } catch(Exception re) {
                    log.error("Error customizing theme for weblog - "+getActionWeblog().getHandle(), re);
                    // TODO: i18n
                    addError("Error importing theme");
                }
               
                if(!hasActionErrors()) try {
                    weblog.setEditorTheme(WeblogTheme.CUSTOM);
                    log.debug("Saving custom theme for weblog "+weblog.getHandle());
                   
                    // save updated weblog and flush
                    WebloggerFactory.getWeblogger().getWeblogManager().saveWeblog(weblog);
                    WebloggerFactory.getWeblogger().flush();
                   
                    // make sure to flush the page cache so ppl can see the change
                    CacheManager.invalidate(weblog);
                   
                    // TODO: i18n
                    addMessage("Successfully set theme to - "+WeblogTheme.CUSTOM);
                    if (t != null) {
                        addMessage("Successfully copied templates from theme - " + t.getName());
                    }
                   
                    // reset import theme options
                    setImportTheme(false);
                    setImportThemeId(null);
View Full Code Here

TOP

Related Classes of org.apache.roller.weblogger.business.themes.SharedTheme

Copyright © 2018 www.massapicom. 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.