Examples of WeblogRequest


Examples of org.apache.roller.presentation.WeblogRequest

                                HttpServletResponse response,
                                Context ctx)
            throws IOException {
       
        Template template = null;
        WeblogRequest weblogRequest = null;
        WebsiteData weblog = null;
       
        // first off lets parse the incoming request and validate it
        try {
            weblogRequest = new WeblogRequest(request);
           
            // now make sure the specified weblog really exists
            UserManager userMgr = RollerFactory.getRoller().getUserManager();
            weblog = userMgr.getWebsiteByHandle(weblogRequest.getWeblogHandle(), Boolean.TRUE);
           
        } catch(InvalidRequestException ire) {
            // An error initializing the request is considered to be a 404
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
            request.setAttribute("DisplayException", ire);
            mLogger.error("Bad Request: "+ire.getMessage());
           
            return null;
           
        } catch(RollerException re) {
            // error looking up the weblog, we assume it doesn't exist
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
            request.setAttribute("DisplayException", re);
            mLogger.warn("Unable to lookup weblog ["+
                    weblogRequest.getWeblogHandle()+"] "+re.getMessage());
           
            return null;
        }
       
       
View Full Code Here

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

   
   
    public void init(Map initData) throws RollerException {
       
        // need a weblog request so that we can know the weblog and locale
        WeblogRequest weblogRequest = (WeblogRequest) initData.get("weblogRequest");
        if(weblogRequest == null) {
            throw new RollerException("Expected 'weblogRequest' init param!");
        }
       
        // PreviewURLModel only works on preview requests, so cast weblogRequest
        // into a WeblogPreviewRequest and if it fails then throw exception
        if(weblogRequest instanceof WeblogPreviewRequest) {
            this.previewRequest = (WeblogPreviewRequest) weblogRequest;
        } else {
            throw new RollerException("weblogRequest is not a WeblogPreviewRequest."+
                    "  PreviewURLModel only supports preview requests.");
        }
       
        this.weblog = weblogRequest.getWeblog();
        this.locale = weblogRequest.getLocale();
       
        super.init(initData);
    }
View Full Code Here

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

     * Init model.
     */
    public void init(Map initData) throws RollerException {
       
        // we expect the init data to contain a weblogRequest object
        WeblogRequest weblogRequest = (WeblogRequest) initData.get("weblogRequest");
        if(weblogRequest == null) {
            throw new RollerException("expected weblogRequest from init data");
        }
       
        // PreviewPageModel only works on preview requests, so cast weblogRequest
View Full Code Here

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

       
        // extract request object
        this.request = (HttpServletRequest) initData.get("request");       

        // extract timezone if available
        WeblogRequest weblogRequest = (WeblogRequest)initData.get("weblogRequest");
        if (weblogRequest != null && weblogRequest.getWeblog() != null) {
            tz = weblogRequest.getWeblog().getTimeZoneInstance();
        }
    }
View Full Code Here

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

     * Init page model based on request.
     */
    public void init(Map initData) throws RollerException {
       
        // we expect the init data to contain a weblogRequest object
        WeblogRequest weblogRequest = (WeblogRequest) initData.get("weblogRequest");
        if(weblogRequest == null) {
            throw new RollerException("expected weblogRequest from init data");
        }
       
        // PageModel only works on page requests, so cast weblogRequest
View Full Code Here

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

   
   
    public void init(Map initData) throws RollerException {
       
        // we expect the init data to contain a weblogRequest object
        WeblogRequest weblogRequest = (WeblogRequest) initData.get("weblogRequest");
        if(weblogRequest == null) {
            throw new RollerException("expected weblogRequest from init data");
        }
       
        // PageModel only works on page requests, so cast weblogRequest
View Full Code Here

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

    }
   
    public void init(Map initData) throws RollerException {
       
        // need a weblog request so that we can know the weblog and locale
        WeblogRequest weblogRequest = (WeblogRequest) initData.get("weblogRequest");
        if(weblogRequest == null) {
            throw new RollerException("Expected 'weblogRequest' init param!");
        }
       
        this.weblog = weblogRequest.getWeblog();
        this.locale = weblogRequest.getLocale();
       
        // need page context as well :(
        pageContext = (PageContext) initData.get("pageContext");
    }
View Full Code Here

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

       
        log.debug("Entering");
       
        WebsiteData weblog = null;
       
        WeblogRequest weblogRequest = null;
        try {
            weblogRequest = new WeblogRequest(request);
           
            // now make sure the specified weblog really exists
            weblog = weblogRequest.getWeblog();
            if(weblog == null) {
                throw new RollerException("Unable to lookup weblog: "+
                        weblogRequest.getWeblogHandle());
            }
           
        } catch(Exception e) {
            // invalid rsd request format or weblog doesn't exist
            log.debug("error creating weblog request", e);
View Full Code Here

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

       
        // extract request object
        this.request = (HttpServletRequest) initData.get("request");       

        // extract timezone if available
        WeblogRequest weblogRequest = (WeblogRequest)initData.get("weblogRequest");
        if (weblogRequest != null && weblogRequest.getWeblog() != null) {
            tz = weblogRequest.getWeblog().getTimeZoneInstance();
        }
    }
View Full Code Here

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

     * Init page model based on request.
     */
    public void init(Map initData) throws RollerException {
       
        // we expect the init data to contain a weblogRequest object
        WeblogRequest weblogRequest = (WeblogRequest) initData.get("weblogRequest");
        if(weblogRequest == null) {
            throw new RollerException("expected weblogRequest from init data");
        }
       
        // PageModel only works on page requests, so cast weblogRequest
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.