Examples of ThemeTemplate


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

        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

       
        Map pages = new TreeMap();
       
        // first get the pages from the db
        try {
            ThemeTemplate template = null;
            Iterator dbPages = WebloggerFactory.getWeblogger().getWeblogManager()
                    .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

        // 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
            ThemeTemplate override = WebloggerFactory.getWeblogger()
                    .getWeblogManager().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

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

    public ThemeTemplate getTemplateByLink(String link) throws WebloggerException {
       
        if(link == null)
            return null;
       
        ThemeTemplate template = null;
       
        // if name refers to the stylesheet then return result of getStylesheet()
        ThemeTemplate stylesheet = getStylesheet();
        if(stylesheet != null && link.equals(stylesheet.getLink())) {
            return stylesheet;
        }
       
        // first check if this user has selected a theme
        // if so then return the proper theme template
View Full Code Here

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

       
        MediaFileDirectory root = fileMgr.getMediaFileRootDirectory(website);
        log.warn("Weblog " + website.getHandle() + " does not have a root MediaFile directory");

        Set importedActionTemplates = new HashSet();
        ThemeTemplate themeTemplate = null;
        ThemeTemplate stylesheetTemplate = theme.getStylesheet();
        Iterator iter = theme.getTemplates().iterator();
        while (iter.hasNext()) {
            themeTemplate = (ThemeTemplate) iter.next();

            WeblogTemplate template = null;
View Full Code Here

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

   
   
    @Override
    public void myPrepare() {
       
        ThemeTemplate stylesheet = null;
        try {
            stylesheet = getActionWeblog().getTheme().getStylesheet();
        } catch (WebloggerException ex) {
            log.error("Error looking up stylesheet on weblog - "+getActionWeblog().getHandle(), ex);
        }
       
        if(stylesheet != null) {
            log.debug("custom stylesheet path is - "+stylesheet.getLink());
            try {
                setTemplate(WebloggerFactory.getWeblogger().getWeblogManager()
                        .getPageByLink(getActionWeblog(), stylesheet.getLink()));
               
                if(getTemplate() == null) {
                    log.debug("custom stylesheet not found, creating it");
                   
                    // template doesn't exist yet, so create it
                    WeblogTemplate stylesheetTmpl = new WeblogTemplate();
                    stylesheetTmpl.setWebsite(getActionWeblog());
                    stylesheetTmpl.setAction(stylesheet.ACTION_CUSTOM);
                    stylesheetTmpl.setName(stylesheet.getName());
                    stylesheetTmpl.setDescription(stylesheet.getDescription());
                    stylesheetTmpl.setLink(stylesheet.getLink());
                    stylesheetTmpl.setContents(stylesheet.getContents());
                    stylesheetTmpl.setHidden(false);
                    stylesheetTmpl.setNavbar(false);
                    stylesheetTmpl.setLastModified(new Date());
                    stylesheetTmpl.setTemplateLanguage(stylesheet.getTemplateLanguage());
                   
                    WebloggerFactory.getWeblogger().getWeblogManager().savePage(stylesheetTmpl);
                    WebloggerFactory.getWeblogger().flush();
                   
                    setTemplate(stylesheetTmpl);
View Full Code Here

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

      }
       
        }
       
        // 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

                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
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.