Examples of WeblogPageRequest


Examples of org.apache.roller.presentation.WeblogPageRequest

        }
        String requestUrl = reqsb.toString();
       
        // parse the incoming request and make sure it's a valid page request
        WebsiteData weblog = null;
        WeblogPageRequest pageRequest = null;
        try {
            pageRequest = new WeblogPageRequest(request);
            UserManager userMgr = RollerFactory.getRoller().getUserManager();
            weblog = userMgr.getWebsiteByHandle(pageRequest.getWeblogHandle());
           
            if(weblog == null) {
                throw new Exception("no weblog named "+pageRequest.getWeblogHandle());
            }
           
        } catch(Exception ex) {
            // bad url or couldn't obtain weblog
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
            return;
        }
       
        // determine if this request came from a robot
        if (robotPattern != null) {
            // If the pattern is present, we check for whether the User-Agent matches,
            // and set isRobot if so.  Currently, all referral processing, including
            // spam check, is skipped for robots identified in this way.
            String userAgent = request.getHeader("User-Agent");
            isRobot = (userAgent != null && userAgent.length() > 0 && robotPattern.matcher(userAgent).matches());
        }
       
        // validate the referrer
        if (pageRequest != null && pageRequest.getWeblogHandle() != null && !isRobot) {
           
            RollerContext rctx = RollerContext.getRollerContext();
           
            // Base page URLs, with and without www.
            String basePageUrlWWW =
                    rctx.getAbsoluteContextUrl(request)+"/page/"+weblog.getHandle();
            String basePageUrl = basePageUrlWWW;
            if ( basePageUrlWWW.startsWith("http://www.") ) {
                // chop off the http://www.
                basePageUrl = "http://"+basePageUrlWWW.substring(11);
            }
           
            // ignore referrers coming from users own blog
            if (referrerUrl == null ||
                    (!referrerUrl.startsWith(basePageUrl) &&
                    !referrerUrl.startsWith(basePageUrlWWW))) {
               
                String selfSiteFragment = "/page/"+weblog.getHandle();

                // validate the referrer
                if ( referrerUrl != null ) {
                    // ignore a Referrer from the persons own blog
                    if (referrerUrl.indexOf(selfSiteFragment) != -1) {
                        referrerUrl = null;
                        ignoreReferrer = true;
                    } else {
                        // treat editor referral as direct
                        int lastSlash = requestUrl.indexOf("/", 8);
                        if (lastSlash == -1) lastSlash = requestUrl.length();
                        String requestSite = requestUrl.substring(0, lastSlash);
                       
                        if (referrerUrl.matches(requestSite + ".*\\.do.*")) {
                            referrerUrl = null;
                        } else {
                            // If referer URL is blacklisted, throw it out
                            isRefSpammer = SpamChecker.checkReferrer(weblog, referrerUrl);
                        }
                    }
                }
               
            } else {
                mLogger.debug("Ignoring referer = "+referrerUrl);
                ignoreReferrer = true;
            }
        }
       
        // pre-processing complete, let's finish the job
        if (isRefSpammer) {
            // spammers get a 403 Access Denied
            response.sendError(HttpServletResponse.SC_FORBIDDEN);
            return;
           
        } else if(!isRobot && !ignoreReferrer) {
            // referrer is valid, lets record it
            try {
                IncomingReferrer referrer = new IncomingReferrer();
                referrer.setReferrerUrl(referrerUrl);
                referrer.setRequestUrl(requestUrl);
                referrer.setWeblogHandle(pageRequest.getWeblogHandle());
                referrer.setWeblogAnchor(pageRequest.getWeblogAnchor());
                referrer.setWeblogDateString(pageRequest.getWeblogDate());
               
                ReferrerQueueManager refQueue =
                    RollerFactory.getRoller().getReferrerQueueManager();
                refQueue.processReferrer(referrer);
            } catch(Exception e) {
View Full Code Here

Examples of org.apache.roller.presentation.WeblogPageRequest

        mLogger.debug("entering");
       
        HttpServletRequest request = (HttpServletRequest) req;
        HttpServletResponse response = (HttpServletResponse) res;
       
        WeblogPageRequest pageRequest = null;
        try {
            pageRequest = new WeblogPageRequest(request);
        } catch(Exception e) {
            mLogger.error("error creating page request", e);
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
            return;
        }
       
        String key = this.CACHE_ID+":"+this.generateKey(pageRequest);
       
        Date updateTime = null;
        try {
            // we need the last expiration time for the given weblog
            long lastExpiration = 0;
            Date lastExpirationDate =
                    (Date) CacheManager.getLastExpiredDate(pageRequest.getWeblogHandle());
            if(lastExpirationDate != null)
                lastExpiration = lastExpirationDate.getTime();
           
            LazyExpiringCacheEntry entry =
                    (LazyExpiringCacheEntry) this.mCache.get(key);
            if(entry != null) {
                updateTime = (Date) entry.getValue(lastExpiration);
               
                if(updateTime == null)
                    mLogger.debug("HIT-INVALID "+key);
            }
           
            if (updateTime == null) {
                mLogger.debug("MISS "+key);
               
                if(pageRequest.getWeblogHandle() != null) {
                    // just set updateTime to now
                    updateTime = new Date();
                    this.mCache.put(key, new LazyExpiringCacheEntry(updateTime));
                }
               
View Full Code Here

Examples of org.apache.roller.presentation.WeblogPageRequest

        mLogger.debug("entering");
       
        HttpServletRequest request = (HttpServletRequest) req;
        HttpServletResponse response = (HttpServletResponse) res;
       
        WeblogPageRequest pageRequest = null;
        try {
            pageRequest = new WeblogPageRequest(request);
        } catch(Exception e) {
            // some kind of error parsing the request
            mLogger.error("error creating page request", e);
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
            return;
        }
       
        String key = this.CACHE_ID+":"+this.generateKey(pageRequest);
       
        try {
            ResponseContent respContent = null;
            if(!this.excludeOwnerPages || !pageRequest.isLoggedIn()) {
                // we need the last expiration time for the given weblog
                long lastExpiration = 0;
                Date lastExpirationDate =
                        (Date) CacheManager.getLastExpiredDate(pageRequest.getWeblogHandle());
                if(lastExpirationDate != null)
                    lastExpiration = lastExpirationDate.getTime();
               
                LazyExpiringCacheEntry entry =
                        (LazyExpiringCacheEntry) this.mCache.get(key);
                if(entry != null) {
                    respContent = (ResponseContent) entry.getValue(lastExpiration);
                   
                    if(respContent == null)
                        mLogger.debug("HIT-INVALID "+key);
                }
            }
           
            if (respContent == null) {
               
                mLogger.debug("MISS "+key);
                this.misses++;
               
                CacheHttpServletResponseWrapper cacheResponse =
                        new CacheHttpServletResponseWrapper(response);
               
                chain.doFilter(request, cacheResponse);
               
                cacheResponse.flushBuffer();
               
                // Store as the cache content the result of the response
                // if no exception was noted by content generator.
                if (request.getAttribute("DisplayException") == null) {
                    ResponseContent rc = cacheResponse.getContent();
                   
                    // only cache if this is not a logged in user?
                    if (!this.excludeOwnerPages || !pageRequest.isLoggedIn()) {
                        if (rc != null && rc.getSize() > 0) {
                            this.mCache.put(key, new LazyExpiringCacheEntry(rc));
                        } else {
                            mLogger.debug("Not caching zero length content for key: " + key);
                        }
View Full Code Here

Examples of org.apache.roller.ui.rendering.util.WeblogPageRequest

       
       
        WebsiteData weblog = null;
        boolean isSiteWide = false;
       
        WeblogPageRequest pageRequest = null;
        try {
            pageRequest = new WeblogPageRequest(request);
           
            weblog = pageRequest.getWeblog();
            if(weblog == null) {
                throw new RollerException("unable to lookup weblog: "+
                        pageRequest.getWeblogHandle());
            }
           
            // is this the site-wide weblog?
            isSiteWide = RollerRuntimeConfig.isSiteWideWeblog(pageRequest.getWeblogHandle());
           
        } catch (Exception e) {
            // some kind of error parsing the request or looking up weblog
            log.debug("error creating page request", e);
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
            return;
        }
       
       
        // determine the lastModified date for this content
        long lastModified = System.currentTimeMillis();
        if(isSiteWide) {
            lastModified = siteWideCache.getLastModified().getTime();
        } else if (weblog.getLastModified() != null) {
            lastModified = weblog.getLastModified().getTime();
        }

        // 304 Not Modified handling.
        // We skip this for logged in users to avoid the scenerio where a user
        // views their weblog, logs in, then gets a 304 without the 'edit' links
        if(!pageRequest.isLoggedIn()) {
            if (ModDateHeaderUtil.respondIfNotModified(request,response,lastModified)) {
                return;
            } else {
                // set last-modified date
                ModDateHeaderUtil.setLastModifiedHeader(response,lastModified);
            }
        }

               
        // generate cache key
        String cacheKey = null;
        if(isSiteWide) {
            cacheKey = siteWideCache.generateKey(pageRequest);
        } else {
            cacheKey = weblogPageCache.generateKey(pageRequest);
        }
       
        // cached content checking
        if((!this.excludeOwnerPages || !pageRequest.isLoggedIn()) &&
                request.getAttribute("skipCache") == null) {
           
            CachedContent cachedContent = null;
            if(isSiteWide) {
                cachedContent = (CachedContent) siteWideCache.get(cacheKey);
            } else {
                cachedContent = (CachedContent) weblogPageCache.get(cacheKey, lastModified);
            }
           
            if(cachedContent != null) {
                log.debug("HIT "+cacheKey);
               
                // allow for hit counting
                if(!isSiteWide) {
                    this.processHit(weblog, request.getRequestURL().toString(), request.getHeader("referer"));
                }
       
                response.setContentLength(cachedContent.getContent().length);
                response.setContentType(cachedContent.getContentType());
                response.getOutputStream().write(cachedContent.getContent());
                return;
               
            } else {
                log.debug("MISS "+cacheKey);
            }
        }

       
        // figure out what we are going to render
        Template page = null;
       
        // If this is a popup request, then deal with it specially
        // TODO: do we really need to keep supporting this?
        if (request.getParameter("popup") != null) {
            try {
                // Does user have a popupcomments page?
                page = weblog.getPageByName("_popupcomments");
            } catch(Exception e ) {
                // ignored ... considered page not found
            }
           
            // User doesn't have one so return the default
            if(page == null) {
                page = new WeblogTemplate("templates/weblog/popupcomments.vm", weblog,
                        "Comments", "Comments", "dummy_link",
                        "dummy_template", new Date(), "velocity", true, false, null);
            }
           
        // If request specified the page, then go with that
        } else if (pageRequest.getWeblogPageName() != null) {
            page = pageRequest.getWeblogPage();
           
        // If page not available from request, then use weblog's default
        } else {
            try {
                page = weblog.getDefaultPage();
            } catch(Exception e) {
                log.error("Error getting weblogs default page", e);
            }
        }
       
        // Still no page?  Then that is a 404
        if (page == null) {
            if(!response.isCommitted()) response.reset();
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
            return;
        }
       
        log.debug("page found, dealing with it");
       
       
        // validation.  make sure that request input makes sense.
        boolean invalid = false;
        if(pageRequest.getWeblogPageName() != null && page.isHidden()) {
            invalid = true;
        }
        if(pageRequest.getLocale() != null) {
           
            // locale view only allowed if weblog has enabled it
            if(!pageRequest.getWeblog().isEnableMultiLang()) {
                invalid = true;
            }
           
        }
        if(pageRequest.getWeblogAnchor() != null) {
           
            // permalink specified.
            // entry must exist, be published before current time, and locale must match
            WeblogEntryData entry = pageRequest.getWeblogEntry();
            if(entry == null) {
                invalid = true;
            } else if (pageRequest.getLocale() != null &&
                    !entry.getLocale().startsWith(pageRequest.getLocale())) {
                invalid = true;
            } else if (!entry.isPublished()) {
                invalid = true;
            } else if (new Date().before(entry.getPubTime())) {
                invalid = true;
            }
           
        } else if(pageRequest.getWeblogCategoryName() != null) {
           
            // category specified.  category must exist.
            if(pageRequest.getWeblogCategory() == null) {
                invalid = true;
            }
           
        } else if(pageRequest.getTags() != null && pageRequest.getTags().size() > 0) {
           
            try {
                // tags specified.  make sure they exist.
                WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
                invalid = !wmgr.getTagComboExists(pageRequest.getTags(), (isSiteWide) ? null : weblog);
            } catch (RollerException ex) {
                invalid = true;
            }
        }

       
        if(invalid) {
            if(!response.isCommitted()) response.reset();
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
            return;
        }
       
       
        // allow for hit counting
        if(!isSiteWide) {
            this.processHit(weblog, request.getRequestURL().toString(), request.getHeader("referer"));
        }
       

        // looks like we need to render content
       
        // set the content type
        String mimeType = RollerContext.getServletContext().getMimeType(page.getLink());
        String contentType = "text/html; charset=utf-8";
        if(mimeType != null) {
            // we found a match ... set the content type
            contentType = mimeType+"; charset=utf-8";
        }

        HashMap model = new HashMap();
        try {
            PageContext pageContext = JspFactory.getDefaultFactory().getPageContext(
                    this, request, response,"", false, 8192, true);
           
            // special hack for menu tag
            request.setAttribute("pageRequest", pageRequest);
           
            // populate the rendering model
            Map initData = new HashMap();
            initData.put("request", request);
            initData.put("requestParameters", request.getParameterMap());
            initData.put("weblogRequest", pageRequest);
            initData.put("pageContext", pageContext);
           
            // if this was a comment posting, check for comment form
            WeblogEntryCommentForm commentForm =
                    (WeblogEntryCommentForm) request.getAttribute("commentForm");
            if(commentForm != null) {
                initData.put("commentForm", commentForm);
            }
           
            // Load models for pages
            String pageModels = RollerConfig.getProperty("rendering.pageModels");
            ModelLoader.loadModels(pageModels, model, initData, true);
           
            // Load special models for site-wide blog
            if(RollerRuntimeConfig.isSiteWideWeblog(weblog.getHandle())) {
                String siteModels = RollerConfig.getProperty("rendering.siteModels");
                ModelLoader.loadModels(siteModels, model, initData, true);
            }

            // Load weblog custom models
            ModelLoader.loadCustomModels(weblog, model, initData);
           
            // ick, gotta load pre-3.0 model stuff as well :(
            ModelLoader.loadOldModels(model, request, response, pageContext, pageRequest);
           
        } catch (RollerException ex) {
            log.error("Error loading model objects for page", ex);
           
            if(!response.isCommitted()) response.reset();
            response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
            return;
        }
       
       
        // lookup Renderer we are going to use
        Renderer renderer = null;
        try {
            log.debug("Looking up renderer");
            renderer = RendererManager.getRenderer(page);
        } catch(Exception e) {
            // nobody wants to render my content :(
            log.error("Couldn't find renderer for page "+page.getId(), e);
           
            if(!response.isCommitted()) response.reset();
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
            return;
        }
       
        // render content.  use size of about 24K for a standard page
        CachedContent rendererOutput = new CachedContent(24567, contentType);
        try {
            log.debug("Doing rendering");
            renderer.render(model, rendererOutput.getCachedWriter());
           
            // flush rendered output and close
            rendererOutput.flush();
            rendererOutput.close();
        } catch(Exception e) {
            // bummer, error during rendering
            log.error("Error during rendering for page "+page.getId(), e);
           
            if(!response.isCommitted()) response.reset();
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
            return;
        }
       
       
        // post rendering process
       
        // flush rendered content to response
        log.debug("Flushing response output");
        response.setContentType(contentType);
        response.setContentLength(rendererOutput.getContent().length);
        response.getOutputStream().write(rendererOutput.getContent());
       
        // cache rendered content.  only cache if user is not logged in?
        if((!this.excludeOwnerPages || !pageRequest.isLoggedIn()) &&
                request.getAttribute("skipCache") == null) {
            log.debug("PUT "+cacheKey);
           
            // put it in the right cache
            if(isSiteWide) {
View Full Code Here

Examples of org.apache.roller.ui.rendering.util.WeblogPageRequest

       
        // bleh!  because ref processing does a flush it will close
        // our hibernate session and cause lazy init exceptions on
        // objects we have fetched, so we need to use a separate
        // page request object for this
        WeblogPageRequest pageRequest;
        try {
            pageRequest = new WeblogPageRequest(request);
        } catch (InvalidRequestException ex) {
            return false;
        }
       
        // if this came from site-wide frontpage then skip it
        if(RollerRuntimeConfig.isSiteWideWeblog(pageRequest.getWeblogHandle())) {
            return false;
        }
       
        // if this came from a robot then don't process it
        if (robotPattern != null) {
            String userAgent = request.getHeader("User-Agent");
            if (userAgent != null && userAgent.length() > 0 &&
                    robotPattern.matcher(userAgent).matches()) {
                log.debug("skipping referrer from robot");
                return false;
            }
        }
       
        String referrerUrl = request.getHeader("Referer");
        StringBuffer reqsb = request.getRequestURL();
        if (request.getQueryString() != null) {
            reqsb.append("?");
            reqsb.append(request.getQueryString());
        }
        String requestUrl = reqsb.toString();
       
        log.debug("referrer = "+referrerUrl);
       
        // if this came from persons own blog then don't process it
        String selfSiteFragment = "/"+pageRequest.getWeblogHandle();
        if (referrerUrl != null && referrerUrl.indexOf(selfSiteFragment) != -1) {
            log.debug("skipping referrer from own blog");
            return false;
        }
       
        // validate the referrer
        if (pageRequest != null && pageRequest.getWeblogHandle() != null) {
           
            // Base page URLs, with and without www.
            String basePageUrlWWW =
                    RollerRuntimeConfig.getAbsoluteContextURL() + "/" + pageRequest.getWeblogHandle();
            String basePageUrl = basePageUrlWWW;
            if ( basePageUrlWWW.startsWith("http://www.") ) {
                // chop off the http://www.
                basePageUrl = "http://"+basePageUrlWWW.substring(11);
            }
           
            // ignore referrers coming from users own blog
            if (referrerUrl == null ||
                    (!referrerUrl.startsWith(basePageUrl) &&
                    !referrerUrl.startsWith(basePageUrlWWW))) {
               
                // validate the referrer
                if ( referrerUrl != null ) {
                    // treat editor referral as direct
                    int lastSlash = requestUrl.indexOf("/", 8);
                    if (lastSlash == -1) lastSlash = requestUrl.length();
                    String requestSite = requestUrl.substring(0, lastSlash);
                   
                    if (referrerUrl.matches(requestSite + ".*\\.do.*")) {
                        referrerUrl = null;
                    } else if(SpamChecker.checkReferrer(pageRequest.getWeblog(), referrerUrl)) {
                        return true;
                    }
                }

            } else {
                log.debug("Ignoring referer = "+referrerUrl);
                return false;
            }
        }
       
        // referrer is valid, lets record it
        try {
            IncomingReferrer referrer = new IncomingReferrer();
            referrer.setReferrerUrl(referrerUrl);
            referrer.setRequestUrl(requestUrl);
            referrer.setWeblogHandle(pageRequest.getWeblogHandle());
            referrer.setWeblogAnchor(pageRequest.getWeblogAnchor());
            referrer.setWeblogDateString(pageRequest.getWeblogDate());
           
            ReferrerQueueManager refQueue =
                    RollerFactory.getRoller().getReferrerQueueManager();
            refQueue.processReferrer(referrer);
        } catch(Exception e) {
View Full Code Here

Examples of org.apache.roller.ui.rendering.util.WeblogPageRequest

            // this is a little hacky, but nothing we can do about it
            // we need the 'weblogRequest' to be a pageRequest so other models
            // are properly loaded, which means that searchRequest needs its
            // own custom initData property aside from the standard weblogRequest.
            // possible better approach is make searchRequest extend pageRequest.
            WeblogPageRequest pageRequest = new WeblogPageRequest();
            pageRequest.setWeblogHandle(searchRequest.getWeblogHandle());
            pageRequest.setWeblogCategoryName(searchRequest.getWeblogCategoryName());
            initData.put("weblogRequest", pageRequest);
            initData.put("searchRequest", searchRequest);
           
            // Load models for pages
            String searchModels = RollerConfig.getProperty("rendering.searchModels");
View Full Code Here

Examples of org.apache.roller.ui.rendering.util.WeblogPageRequest

            String handle = (String)request.getSession().getAttribute(RequestConstants.WEBLOG_SESSION_STASH);
            weblog = roller.getUserManager().getWebsiteByHandle(handle);
        } else {
            // check rendering system form of URL
            // TODO: hack.  we expect the parsed request as an HttpRequest attr
            WeblogPageRequest pageRequest = (WeblogPageRequest) request.getAttribute("pageRequest");
            if(pageRequest != null) {
                weblog = pageRequest.getWeblog();
            }
        }
        return weblog;
   
View Full Code Here

Examples of org.apache.roller.ui.rendering.util.WeblogPageRequest

       
        // bleh!  because ref processing does a flush it will close
        // our hibernate session and cause lazy init exceptions on
        // objects we have fetched, so we need to use a separate
        // page request object for this
        WeblogPageRequest pageRequest;
        try {
            pageRequest = new WeblogPageRequest(request);
        } catch (InvalidRequestException ex) {
            return false;
        }
       
        // if this came from site-wide frontpage then skip it
        if(RollerRuntimeConfig.isSiteWideWeblog(pageRequest.getWeblogHandle())) {
            return false;
        }
       
        // if this came from a robot then don't process it
        if (robotPattern != null) {
            String userAgent = request.getHeader("User-Agent");
            if (userAgent != null && userAgent.length() > 0 &&
                    robotPattern.matcher(userAgent).matches()) {
                log.debug("skipping referrer from robot");
                return false;
            }
        }
       
        String referrerUrl = request.getHeader("Referer");
        StringBuffer reqsb = request.getRequestURL();
        if (request.getQueryString() != null) {
            reqsb.append("?");
            reqsb.append(request.getQueryString());
        }
        String requestUrl = reqsb.toString();
       
        log.debug("referrer = "+referrerUrl);
       
        // if this came from persons own blog then don't process it
        String selfSiteFragment = "/"+pageRequest.getWeblogHandle();
        if (referrerUrl != null && referrerUrl.indexOf(selfSiteFragment) != -1) {
            log.debug("skipping referrer from own blog");
            return false;
        }
       
        // validate the referrer
        if (pageRequest != null && pageRequest.getWeblogHandle() != null) {
           
            // Base page URLs, with and without www.
            String basePageUrlWWW =
                    RollerRuntimeConfig.getAbsoluteContextURL() + "/" + pageRequest.getWeblogHandle();
            String basePageUrl = basePageUrlWWW;
            if ( basePageUrlWWW.startsWith("http://www.") ) {
                // chop off the http://www.
                basePageUrl = "http://"+basePageUrlWWW.substring(11);
            }
           
            // ignore referrers coming from users own blog
            if (referrerUrl == null ||
                    (!referrerUrl.startsWith(basePageUrl) &&
                    !referrerUrl.startsWith(basePageUrlWWW))) {
               
                // validate the referrer
                if ( referrerUrl != null ) {
                    // treat editor referral as direct
                    int lastSlash = requestUrl.indexOf("/", 8);
                    if (lastSlash == -1) lastSlash = requestUrl.length();
                    String requestSite = requestUrl.substring(0, lastSlash);
                   
                    if (referrerUrl.matches(requestSite + ".*\\.do.*")) {
                        referrerUrl = null;
                    } else if(SpamChecker.checkReferrer(pageRequest.getWeblog(), referrerUrl)) {
                        return true;
                    }
                }

            } else {
                log.debug("Ignoring referer = "+referrerUrl);
                return false;
            }
        }
       
        // referrer is valid, lets record it
        try {
            IncomingReferrer referrer = new IncomingReferrer();
            referrer.setReferrerUrl(referrerUrl);
            referrer.setRequestUrl(requestUrl);
            referrer.setWeblogHandle(pageRequest.getWeblogHandle());
            referrer.setWeblogAnchor(pageRequest.getWeblogAnchor());
            referrer.setWeblogDateString(pageRequest.getWeblogDate());
           
            ReferrerQueueManager refQueue =
                    RollerFactory.getRoller().getReferrerQueueManager();
            refQueue.processReferrer(referrer);
        } catch(Exception e) {
View Full Code Here

Examples of org.apache.roller.ui.rendering.util.WeblogPageRequest

            // this is a little hacky, but nothing we can do about it
            // we need the 'weblogRequest' to be a pageRequest so other models
            // are properly loaded, which means that searchRequest needs its
            // own custom initData property aside from the standard weblogRequest.
            // possible better approach is make searchRequest extend pageRequest.
            WeblogPageRequest pageRequest = new WeblogPageRequest();
            pageRequest.setWeblogHandle(searchRequest.getWeblogHandle());
            pageRequest.setWeblogCategoryName(searchRequest.getWeblogCategoryName());
            initData.put("weblogRequest", pageRequest);
            initData.put("searchRequest", searchRequest);
           
            // Load models for pages
            String searchModels = RollerConfig.getProperty("rendering.searchModels");
View Full Code Here

Examples of org.apache.roller.ui.rendering.util.WeblogPageRequest

            String handle = (String)request.getSession().getAttribute(RequestConstants.WEBLOG_SESSION_STASH);
            weblog = roller.getUserManager().getWebsiteByHandle(handle);
        } else {
            // check rendering system form of URL
            // TODO: hack.  we expect the parsed request as an HttpRequest attr
            WeblogPageRequest pageRequest = (WeblogPageRequest) request.getAttribute("pageRequest");
            if(pageRequest != null) {
                weblog = pageRequest.getWeblog();
            }
        }
        return 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.