Examples of ThemeManager


Examples of org.apache.roller.business.ThemeManager

            String[] split = name.split(":", 2);
            if(split.length < 2)
                throw new ResourceNotFoundException("Invalid ThemeRL key "+name);
           
            // lookup the template from the proper theme
            ThemeManager themeMgr = RollerFactory.getRoller().getThemeManager();
            Theme theme = themeMgr.getTheme(split[0]);
            ThemeTemplate template = theme.getTemplate(split[1]);
           
            if(template == null)
                throw new ResourceNotFoundException("Template ["+split[1]+
                        "] doesn't seem to be part of theme ["+split[0]+"]");
View Full Code Here

Examples of org.apache.roller.business.ThemeManager

            String[] split = name.split(":", 2);
            if(split.length < 2)
                return last_mod;
           
            // lookup the template from the proper theme
            ThemeManager themeMgr = RollerFactory.getRoller().getThemeManager();
            Theme theme = themeMgr.getTheme(split[0]);
            ThemeTemplate template = theme.getTemplate(split[1]);
           
            if(template == null)
                return last_mod;
           
View Full Code Here

Examples of org.apache.roller.business.ThemeManager

                        "themeEditor.title", request, response, mapping);
                request.setAttribute("model",pageModel);         
                   
                // get users current theme and our themes list
                Roller roller = RollerFactory.getRoller();
                ThemeManager themeMgr = roller.getThemeManager();
               
                String username = rses.getAuthenticatedUser().getUserName();
                String currentTheme = website.getEditorTheme();
                List themes = themeMgr.getEnabledThemesList();
               
                // this checks if the website has a default page template
                // if not then we don't allow for a custom theme
                boolean allowCustomTheme = true;
                if(website.getDefaultPageId() == null
View Full Code Here

Examples of org.apache.roller.business.ThemeManager

            WebsiteData website = rreq.getWebsite();
            if ( rses.isUserAuthorizedToAdmin(website)) {

                // get users current theme
                Roller roller = RollerFactory.getRoller();
                ThemeManager themeMgr = roller.getThemeManager();
               
                   
                BasePageModel pageModel = new BasePageModel(
                        "themeEditor.title", request, response, mapping);
                request.setAttribute("model",pageModel);         
                   
                String username = rses.getAuthenticatedUser().getUserName();
                String currentTheme = website.getEditorTheme();
                List themes = themeMgr.getEnabledThemesList();
               
                // this checks if the website has a default page template
                // if not then we don't allow for a custom theme
                boolean allowCustomTheme = true;
                if(website.getDefaultPageId() == null
                        || website.getDefaultPageId().equals("dummy")
                        || website.getDefaultPageId().trim().equals(""))
                    allowCustomTheme = false;
               
                // if we allow custom themes then add it to the end of the list
                if(RollerRuntimeConfig.getBooleanProperty("themes.customtheme.allowed")
                        && allowCustomTheme)
                    themes.add(Theme.CUSTOM);
               
                // set the current theme in the request
                request.setAttribute("currentTheme", currentTheme);
                request.setAttribute("themesList", themes);
               
                String theme = request.getParameter("theme");
                try {
                    Theme previewTheme = themeMgr.getTheme(theme);
                   
                    if(previewTheme.isEnabled()) {
                        // make sure the view knows what theme to preview
                        request.setAttribute("previewTheme", previewTheme.getName());
                   
View Full Code Here

Examples of org.apache.roller.business.ThemeManager

               
                // lookup what theme the user wants first
                String theme = request.getParameter("theme");
                try {
                    Roller roller = RollerFactory.getRoller();
                    ThemeManager themeMgr = roller.getThemeManager();
                    Theme previewTheme = themeMgr.getTheme(theme);
                   
                    if(previewTheme.isEnabled()) {
                        newTheme = previewTheme.getName();
                    } else {
                        errors.add(null, new ActionMessage("Theme not enabled"));
View Full Code Here

Examples of org.apache.roller.business.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.importTheme(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.business.ThemeManager

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

Examples of org.apache.roller.business.ThemeManager

                HttpServletResponse response, ActionMapping mapping, WebsiteData wd)
                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 = RollerRuntimeConfig.getAbsoluteContextURL();
                weblogURL = wd.getURL();
                rssURL =    contextURL + "/rss/" + wd.getHandle();
                website = wd;
View Full Code Here

Examples of org.apache.roller.model.ThemeManager

                    "basic",        // theme
                    "en_US_WIN",    // locale
                    "America/Los_Angeles" // timezone
                    );
       
        ThemeManager themeMgr = getRoller().getThemeManager();
        Theme usersTheme = themeMgr.getTheme(website.getEditorTheme());
        themeMgr.saveThemePages(website, usersTheme);
       
        return ud;
    }
View Full Code Here

Examples of org.apache.roller.model.ThemeManager

       
        // first check if this user has selected a theme
        // if so then return the themes Weblog template
        if(this.editorTheme != null && !this.editorTheme.equals(Theme.CUSTOM)) {
            try {
                ThemeManager themeMgr = RollerFactory.getRoller().getThemeManager();
                Theme usersTheme = themeMgr.getTheme(this.editorTheme);
               
                // this is a bit iffy :/
                // we assume that all theme use "Weblog" for a default template
                template = usersTheme.getTemplate("Weblog");
               
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.