Examples of ThemeTemplate


Examples of org.apache.roller.pojos.ThemeTemplate

                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]+"]");
           
            mLogger.debug("Resource found!");
           
            // return the input stream
            return new ByteArrayInputStream(template.getContents().getBytes("UTF-8"));
           
        } catch (UnsupportedEncodingException uex) {
            // We expect UTF-8 in all JRE installation.
            // This rethrows as a Runtime exception after logging.
            mLogger.error(uex);
View Full Code Here

Examples of org.apache.roller.pojos.ThemeTemplate

                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();
           
        } catch (ThemeNotFoundException tnfe) {
            // ignore
        } catch (RollerException re) {
            // we don't like to see this happen, but oh well
View Full Code Here

Examples of org.apache.roller.weblogger.pojos.ThemeTemplate

                mLogger.error("error getting weblog pages", ex);
            }
           
            Iterator pageIter = pages.iterator();
            while (pageIter.hasNext()) {
                ThemeTemplate page = (ThemeTemplate) pageIter.next();
                mPageMap.put(page.getName(),ThemeTemplateWrapper.wrap(page));
            }
        }
    }
View Full Code Here

Examples of org.apache.roller.weblogger.pojos.ThemeTemplate

        mLogger.debug("looking up page ["+pageName+"]");
       
        String template_id = null;
       
        try {
            ThemeTemplate pd = mWebsite.getTheme().getTemplateByName(pageName);
            if(pd != null) {
                template_id = pd.getId();
            }
        } catch(Exception e) {
            mLogger.error(e);
        }
       
View Full Code Here

Examples of org.apache.roller.weblogger.pojos.ThemeTemplate

        if(this.weblogRequest == null) {
            throw new WebloggerException("expected weblogRequest from init data");
        }
       
        if (weblogRequest instanceof WeblogPageRequest) {
            ThemeTemplate weblogPage = ((WeblogPageRequest)weblogRequest).getWeblogPage();
            pageLink = (weblogPage != null) ? weblogPage.getLink() : null;
            pageNum = ((WeblogPageRequest)weblogRequest).getPageNum();
            tags = ((WeblogPageRequest)weblogRequest).getTags();
        } else if (weblogRequest instanceof WeblogFeedRequest) {
            this.feedRequest = (WeblogFeedRequest) weblogRequest;
            tags = feedRequest.getTags();
View Full Code Here

Examples of org.apache.roller.weblogger.pojos.ThemeTemplate

            // add it to the theme
            setResource(resourcePath, new SharedThemeResourceFromDir(resourcePath, resourceFile));
        }
       
        // go through templates and read in contents to a ThemeTemplate
        ThemeTemplate theme_template = null;
        ThemeMetadataTemplate templateMetadata = null;
        Iterator templatesIter = themeMetadata.getTemplates().iterator();
        while (templatesIter.hasNext()) {
            templateMetadata = (ThemeMetadataTemplate) templatesIter.next();
           
View Full Code Here

Examples of org.apache.roller.weblogger.pojos.ThemeTemplate

       
        Map pages = new TreeMap();
       
        // first get the pages from the db
        try {
            ThemeTemplate template = null;
            UserManager userMgr = WebloggerFactory.getWeblogger().getUserManager();
            Iterator dbPages = userMgr.getPages(this.weblog).iterator();
            while(dbPages.hasNext()) {
                template = (ThemeTemplate) dbPages.next();
                pages.put(template.getName(), template);
            }
        } catch(Exception e) {
            // db error
            log.error(e);
        }
       
       
        // now get theme pages if needed and put them in place of db pages
        try {
            ThemeTemplate template = null;
            Iterator themePages = this.theme.getTemplates().iterator();
            while(themePages.hasNext()) {
                template = (ThemeTemplate) themePages.next();
               
                // note that this will put theme pages over custom
                // pages in the pages list, which is what we want
                pages.put(template.getName(), template);
            }
        } catch(Exception e) {
            // how??
            log.error(e);
        }
View Full Code Here

Examples of org.apache.roller.weblogger.pojos.ThemeTemplate

        if(this.weblogRequest == null) {
            throw new WebloggerException("expected weblogRequest from init data");
        }
       
        if (weblogRequest instanceof WeblogPageRequest) {
            ThemeTemplate weblogPage = ((WeblogPageRequest)weblogRequest).getWeblogPage();
            pageLink = (weblogPage != null) ? weblogPage.getLink() : null;
            pageNum = ((WeblogPageRequest)weblogRequest).getPageNum();
       
       
        // look for url strategy
        urlStrategy = (URLStrategy) initData.get("urlStrategy");
View Full Code Here

Examples of org.apache.roller.weblogger.pojos.ThemeTemplate

        // stylesheet is handled differently than other templates because with
        // the stylesheet we want to return the weblog custom version if it
        // exists, otherwise we return the shared theme version
       
        // load from theme first to see if we even support a stylesheet
        ThemeTemplate stylesheet = this.theme.getStylesheet();
        if(stylesheet != null) {
            // now try getting custom version from weblog
            UserManager umgr = WebloggerFactory.getWeblogger().getUserManager();
            ThemeTemplate override = umgr.getPageByLink(this.weblog, stylesheet.getLink());
            if(override != null) {
                stylesheet = override;
            }
        }
       
View Full Code Here

Examples of org.apache.roller.weblogger.pojos.ThemeTemplate

    public ThemeTemplate getTemplateByName(String name) throws WebloggerException {
       
        if(name == null)
            return null;
       
        ThemeTemplate template = null;
       
        // if name refers to the stylesheet then return result of getStylesheet()
        ThemeTemplate stylesheet = getStylesheet();
        if(stylesheet != null && name.equals(stylesheet.getName())) {
            return stylesheet;
        }
       
        // first check if this user has selected a theme
        // if so then return the proper theme template
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.