Package org.apache.roller.pojos

Examples of org.apache.roller.pojos.Theme


                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());
                   
                        mLogger.debug("Previewing theme "+previewTheme.getName()+
                                " to "+username);
                    } else {
                        request.setAttribute("previewTheme", currentTheme);
                        errors.add(null, new ActionMessage("Theme not enabled"));
                        saveErrors(request, errors);
View Full Code Here


                // 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"));
                        saveErrors(request, errors);
                    }
                   
View Full Code Here

                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);
View Full Code Here

            return;
        }
       
        // try getting the preview theme
        log.debug("preview theme = "+previewRequest.getThemeName());
        Theme previewTheme = previewRequest.getTheme();
       
        // construct a temporary Website object for this request
        // and set the EditorTheme to our previewTheme
        WebsiteData tmpWebsite = new WebsiteData();
        tmpWebsite.setData(weblog);
        if(previewTheme != null && previewTheme.isEnabled()) {
            tmpWebsite.setEditorTheme(previewTheme.getName());
        } else if(Theme.CUSTOM.equals(previewRequest.getThemeName())) {
            tmpWebsite.setEditorTheme(Theme.CUSTOM);
        }
       
        // we've got to set the weblog in our previewRequest because that's
View Full Code Here

        long resourceLastMod = 0;
        InputStream resourceStream = null;
       
        // first, see if we have a preview theme to operate from
        if(resourceRequest.getThemeName() != null) {
            Theme theme = resourceRequest.getTheme();
            File resource = theme.getResource(resourceRequest.getResourcePath());
            resourceLastMod = resource.lastModified();
            resourceStream = new FileInputStream(resource);
        }
       
        // second, see if resource comes from weblog's configured shared theme
        if(resourceStream == null && !Theme.CUSTOM.equals(weblog.getEditorTheme())) {
            try {
                ThemeManager themeMgr = RollerFactory.getRoller().getThemeManager();
                Theme weblogTheme = themeMgr.getTheme(weblog.getEditorTheme());
                File resource = weblogTheme.getResource(resourceRequest.getResourcePath());
                if(resource != null) {
                    resourceLastMod = resource.lastModified();
                    resourceStream = new FileInputStream(resource);
                }
            } catch (Exception ex) {
View Full Code Here

       
        // first see if resource comes from weblog's shared theme
        if(!Theme.CUSTOM.equals(weblog.getEditorTheme())) {
            try {
                ThemeManager themeMgr = RollerFactory.getRoller().getThemeManager();
                Theme weblogTheme = themeMgr.getTheme(weblog.getEditorTheme());
                File resource = weblogTheme.getResource(resourceRequest.getResourcePath());
                if(resource != null) {
                    resourceLastMod = resource.lastModified();
                    resourceStream = new FileInputStream(resource);
                }
            } catch (Exception ex) {
View Full Code Here

            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

            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;
           
            last_mod = template.getLastModified().getTime();
View Full Code Here

                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());
                   
                        mLogger.debug("Previewing theme "+previewTheme.getName()+
                                " to "+username);
                    } else {
                        request.setAttribute("previewTheme", currentTheme);
                        errors.add(null, new ActionMessage("Theme not enabled"));
                        saveErrors(request, errors);
View Full Code Here

                // 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"));
                        saveErrors(request, errors);
                    }
                   
View Full Code Here

TOP

Related Classes of org.apache.roller.pojos.Theme

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.