Examples of ThemeManager


Examples of org.apache.roller.model.ThemeManager

                        "themeEditor.title", request, response, mapping);
                request.setAttribute("model",pageModel);         
                   
                // copy down current theme to weblog templates
                Roller roller = RollerFactory.getRoller();
                ThemeManager themeMgr = roller.getThemeManager();
               
                String username = rses.getAuthenticatedUser().getUserName();
               
                try {
                    Theme usersTheme = themeMgr.getTheme(website.getEditorTheme());
                   
                    // only if custom themes are allowed
                    if(RollerRuntimeConfig.getBooleanProperty("themes.customtheme.allowed")) {
                        try {
                            themeMgr.saveThemePages(website, usersTheme);
                            RollerFactory.getRoller().flush();
                        } catch(RollerException re) {
                            mLogger.error(re);
                            errors.add(null, new ActionMessage("Error customizing theme"));
                            saveErrors(request, errors);
View Full Code Here

Examples of org.apache.roller.model.ThemeManager

            throws RollerException
        {
            super("createWebsite.title", request, response, mapping);
            RollerContext rollerContext = RollerContext.getRollerContext();
            Roller roller = RollerFactory.getRoller();
            ThemeManager themeMgr = roller.getThemeManager();
            themes = themeMgr.getEnabledThemesList();
            if (wd != null)
            {
                contextURL = rollerContext.getAbsoluteContextUrl(request);
                weblogURL = contextURL + "/page/" + wd.getHandle();  
                rssURL =    contextURL + "/rss/" + wd.getHandle();   
View Full Code Here

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

    public Theme getTheme() {
       
        if(theme == null && themeName != null) {
            try {
                ThemeManager themeMgr = WebloggerFactory.getWeblogger().getThemeManager();
                theme = themeMgr.getTheme(themeName);
            } catch(ThemeNotFoundException tnfe) {
                // bogus theme specified ... don't worry about it
            } catch(WebloggerException re) {
                log.error("Error looking up theme "+themeName, re);
            }
View Full Code Here

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

     * Get the Theme object in use by this weblog, or null if no theme selected.
     */
    public WeblogTheme getTheme() {
        try {
            // let the ThemeManager handle it
            ThemeManager themeMgr = WebloggerFactory.getWeblogger().getThemeManager();
            return themeMgr.getTheme(this);
        } catch (WebloggerException ex) {
            log.error("Error getting theme for weblog - "+getHandle(), ex);
        }
       
        // TODO: maybe we should return a default theme in this case?
View Full Code Here

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

        }
    }
   
   
    public List getThemes() {
        ThemeManager themeMgr = WebloggerFactory.getWeblogger().getThemeManager();
        return themeMgr.getEnabledThemesList();
    }
View Full Code Here

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

        return WeblogPermission.ADMIN;
    }
   
   
    public void myPrepare() {
        ThemeManager themeMgr = WebloggerFactory.getWeblogger().getThemeManager();
        setThemes(themeMgr.getEnabledThemesList());
    }
View Full Code Here

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

            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);
                   
                } catch(WebloggerException re) {
                    log.error("Error saving weblog - "+getActionWeblog().getHandle(), re);
                    addError("Error setting theme");
                }
            } else {
                // TODO: i18n
                addError("Sorry, custom themes are not allowed");
            }
           
        // we are dealing with a shared theme scenario
        } else if("shared".equals(getThemeType())) {
           
            // make sure theme is valid and enabled
            Theme newTheme = null;
            if(getThemeId() == null) {
                // TODO: i18n
                addError("No theme specified");
               
            } else {
                try {
                    ThemeManager themeMgr = WebloggerFactory.getWeblogger().getThemeManager();
                    newTheme = themeMgr.getTheme(getThemeId());
                   
                    if(!newTheme.isEnabled()) {
                        // TODO: i18n
                        addError("Theme not enabled");
                    }
View Full Code Here

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

        if(!hasActionErrors()) try {
           
            WeblogTemplate stylesheet = getTemplate();
           
            // lookup the theme used by this weblog
            ThemeManager tmgr = WebloggerFactory.getWeblogger().getThemeManager();
            Theme theme = tmgr.getTheme(getActionWeblog().getEditorTheme());
           
            // lookup
            stylesheet.setLastModified(new Date());
            stylesheet.setContents(theme.getStylesheet().getContents());
           
View Full Code Here

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

        InputStream resourceStream = null;
        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

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

        }

        // Development only. Reload if theme has been modified
    if (themeReload) {
      try {
        ThemeManager manager = WebloggerFactory.getWeblogger().getThemeManager();
        boolean reloaded = manager.reLoadThemeFromDisk(weblog.getEditorTheme());
        if (reloaded) {
          if (WebloggerRuntimeConfig.isSiteWideWeblog(searchRequest.getWeblogHandle())) {
            SiteWideCache.getInstance().clear();
          } else {
            WeblogPageCache.getInstance().clear();
View Full Code Here
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.