Package org.apache.roller.presentation

Examples of org.apache.roller.presentation.RollerRequest


        public int getWeblogEntryCount() {
            return entries.size();
        }
       
        public List getCategories() throws Exception {
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            List categories = RollerFactory.getRoller().getWeblogManager()
            .getWeblogCategories(rreq.getWebsite());
            return categories;
        }
View Full Code Here


     * @throws RollerException
     */
    public Template handleRequest(HttpServletRequest request,
            HttpServletResponse response, Context ctx) {
       
        RollerRequest rreq = null;
        try {
            rreq = RollerRequest.getRollerRequest(request, getServletContext());
        } catch (RollerException e) {
            // An error initializing the request is considered to be a 404
            mLogger.debug("RollerRequest threw Exception", e);
View Full Code Here

    public Template handleRequest(HttpServletRequest request,
                                HttpServletResponse response,
                                Context ctx)
            throws IOException {
       
        RollerRequest rreq = null;
        Template outty = null;
       
        // first off lets parse the incoming request and validate it
        try {
            PageContext pageContext =
                    JspFactory.getDefaultFactory().getPageContext(
                    this, request,  response, "", true, 8192, true);
            rreq = RollerRequest.getRollerRequest(pageContext);
           
            // This is an ugly hack to fix the following bug:
            // ROL-547: "Site wide RSS feed is your own if you are logged in"
            String[] pathInfo = StringUtils.split(rreq.getPathInfo(),"/");
            if (pathInfo.length < 1) {
                // If website not specified in URL, set it to null
                rreq.setWebsite(null);
            }
        } catch (RollerException e) {
           
            // An error initializing the request is considered to be a 404
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
            request.setAttribute("DisplayException", e);
           
            return null;
        }
       
       
        // request appears to be valid, lets render
        try {
            // get update time before loading context
            // TODO: this should really be handled elsewhere
            WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
            String catname = request.getParameter(RollerRequest.WEBLOGCATEGORYNAME_KEY);
            Date updateTime = wmgr.getWeblogLastPublishTime(rreq.getWebsite(), catname);
            request.setAttribute("updateTime", updateTime);
           
            ContextLoader.setupContext(ctx, rreq, response);
           
            String useTemplate;
View Full Code Here

                CategoriesForm form) throws RollerException
        {
            super("dummy",  request, response, mapping);
            this.form = form;
           
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();

            allCategories = new TreeSet(new CategoryPathComparator());

            // Find catid wherever it may be
View Full Code Here

            return super.handleRequest(request, response, ctx);
           
        }
       
        Template outty = null;
        RollerRequest rreq = null;
       
        // first off lets parse the incoming request and validate it
        try {
            PageContext pageContext =
                    JspFactory.getDefaultFactory().getPageContext(
                    this, request, response,"", true, 8192, true);
            rreq = RollerRequest.getRollerRequest(pageContext);
        } catch (RollerException e) {
           
            // An error initializing the request is considered to be a 404
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
            request.setAttribute("DisplayException", e);
           
            return null;
        }
       
       
        // request appears to be valid, lets render
        try {
            UserManager userMgr = RollerFactory.getRoller().getUserManager();
           
            WebsiteData website = null;
            if (request.getAttribute(RollerRequest.OWNING_WEBSITE) != null)
            {
                UserData user = (UserData)
                    request.getAttribute(RollerRequest.OWNING_WEBSITE);
            }
            else
            {
                website = rreq.getWebsite();
            }
           
            // construct a temporary Website object for this request
            // and set the EditorTheme to our previewTheme
            WebsiteData tmpWebsite = new WebsiteData();
            tmpWebsite.setData(website);
            if(previewTheme != null)
                tmpWebsite.setEditorTheme(previewTheme.getName());
            else
                tmpWebsite.setEditorTheme(Theme.CUSTOM);
           
            org.apache.roller.pojos.Template page = null;
           
            page = tmpWebsite.getDefaultPage();
           
            // Still no page ID ... probably someone with no templates
            // trying to preview a "custom" theme
            if ( page == null ) {
                // lets just call it a 404 and return
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
                return null;
            }
           
            // update our roller request object
            rreq.setPage(page);
            rreq.setWebsite(tmpWebsite);

            // this sets up the page we want to render
            outty = prepareForPageExecution(ctx, rreq, response, page);
           
            // if there is a decorator template then apply it
View Full Code Here

     */
    public void initNew(HttpServletRequest request, HttpServletResponse response)
    {
        mLogger.debug("init new called");
       
        RollerRequest rreq = RollerRequest.getRollerRequest(request);
        RollerSession rses = RollerSession.getRollerSession(request);
        if (rreq.getWebsite().getDefaultPlugins() != null)
        {
            setPluginsArray(StringUtils.split(
                    rreq.getWebsite().getDefaultPlugins(), ",") );
        }
        status = WeblogEntryData.DRAFT;
        allowComments = Boolean.TRUE;
       
        // we want pubTime and updateTime to be empty for new entries -- AG
View Full Code Here

                returnId = catToDelete.getParent().getId();
            }
            if (form.isDelete() == null)
            {
                // Present CategoryDeleteOK? page to user
                RollerRequest rreq = RollerRequest.getRollerRequest(request);
                WeblogCategoryData theCat = wmgr.getWeblogCategory(catid);
                Iterator allCats =
                    wmgr.getWeblogCategories(theCat.getWebsite()).iterator();
                List destCats = new LinkedList();
                while (allCats.hasNext())
View Full Code Here

       
        HttpSession session = ((HttpServletRequest)req).getSession();
        HttpServletRequest request = (HttpServletRequest)req;
        HttpServletResponse response = (HttpServletResponse)res;
        Roller roller = RollerFactory.getRoller();
        RollerRequest rreq = null;
        try {
            rreq = RollerRequest.getRollerRequest(
                       request, mFilterConfig.getServletContext());
        } catch (Throwable e) {           
            // NOTE: this is not a page-not-found problem
View Full Code Here

            method = "post";
        else if (method.equals("preview"))
            preview = true;
       
        // parse request and validate
        RollerRequest rreq = RollerRequest.getRollerRequest(request);
        HttpSession session = request.getSession();
       
        // make sure we know the entry this comment is going to
        WeblogEntryData entry = rreq.getWeblogEntry();
        if (entry == null || entry.getId() == null) {
            session.setAttribute(RollerSession.ERROR_MESSAGE, "Cannot post comment to null entry");
            RequestDispatcher dispatcher =
                request.getRequestDispatcher(entry_permalink);
            dispatcher.forward(request, response);
View Full Code Here

    public String getContent(Date day)
    {
        String content = null;
        try
        {
      RollerRequest rreq = RollerRequest.getRollerRequest(mReq);
      RollerContext rctx = RollerContext.getRollerContext();
            StringBuffer sb = new StringBuffer();
           
            // get the 8 char YYYYMMDD datestring for day, returns null
            // if no weblog entry on that day
View Full Code Here

TOP

Related Classes of org.apache.roller.presentation.RollerRequest

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.