Examples of RollerRequest


Examples of org.apache.roller.presentation.RollerRequest

            }
            else if (title==null || url==null || excerpt==null || blogName==null) {
                error = "title, url, excerpt, and blog_name not specified.";
            }
            else {               
                RollerRequest rreq = RollerRequest.getRollerRequest(req);
                WeblogEntryData entry = rreq.getWeblogEntry();
                WebsiteData website = entry.getWebsite();
                boolean siteAllows = website.getAllowComments().booleanValue();
               
                if (entry!=null && siteAllows && entry.getCommentsStillAllowed()) {
                   
View Full Code Here

Examples of org.apache.roller.presentation.RollerRequest

        HttpServletResponse response)
        throws Exception
    {
        ActionForward forward = mapping.findForward("categories");
        WeblogCategoryFormEx form = (WeblogCategoryFormEx)actionForm;
        RollerRequest rreq = RollerRequest.getRollerRequest(request);
        WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();

        WeblogCategoryData cd = null;
        if (null != form.getId() && !form.getId().trim().equals(""))
        {
View Full Code Here

Examples of org.apache.roller.presentation.RollerRequest

    public ActionForward view(ActionMapping mapping, ActionForm form,
                              HttpServletRequest req, HttpServletResponse res)
        throws Exception
    {
        ActionForward forward = mapping.findForward(VIEW_PAGE);
        RollerRequest rreq = RollerRequest.getRollerRequest(req);
        try
        {
            BasePageModel pageModel =
                new BasePageModel(getPingTargetsTitle(), req, res, mapping);
            req.setAttribute("model",pageModel);           
            if (!hasRequiredRights(rreq, rreq.getWebsite()))
            {
                return mapping.findForward(ACCESS_DENIED_PAGE);
            }

            List pingTargets = getPingTargets(rreq);
View Full Code Here

Examples of org.apache.roller.presentation.RollerRequest

     */
    public ActionForward save(ActionMapping mapping, ActionForm form,
                              HttpServletRequest req, HttpServletResponse res)
        throws Exception
    {
        RollerRequest rreq = RollerRequest.getRollerRequest(req);
        PingTargetManager pingTargetMgr =
                RollerFactory.getRoller().getPingTargetManager();
        PingTargetForm pingTargetForm = (PingTargetForm) form;
        try
        {
            BasePageModel pageModel =
                new BasePageModel(getPingTargetEditTitle(), req, res, mapping);
            req.setAttribute("model",pageModel);           
            if (!hasRequiredRights(rreq, rreq.getWebsite()))
            {
                return mapping.findForward(ACCESS_DENIED_PAGE);
            }

            PingTargetData pingTarget = null;
            String pingTargetId = pingTargetForm.getId();
            if (pingTargetId != null && pingTargetId.length() > 0)
            {
                pingTarget = pingTargetMgr.getPingTarget(
                        pingTargetForm.getId());
                if (pingTarget == null)
                    throw new RollerException(
                            "No such ping target id: " + pingTargetId);
                pingTargetForm.copyTo(pingTarget, req.getLocale());
            }
            else
            {
                pingTarget = createPingTarget(rreq, pingTargetForm);
            }

            // Call private helper to validate ping target
            // If there are errors, go back to the target edit page.
            ActionMessages errors = validate(rreq, pingTarget);
            if (!errors.isEmpty()) {
                saveErrors(rreq.getRequest(), errors);
                return mapping.findForward(PING_TARGET_EDIT_PAGE);
            }

            // Appears to be ok. 
            // Save it, commit and return refreshed view of target list.
View Full Code Here

Examples of org.apache.roller.presentation.RollerRequest

    public ActionForward editSelected(ActionMapping mapping, ActionForm form,
                                      HttpServletRequest req, HttpServletResponse res)
        throws Exception
    {
        ActionForward forward = mapping.findForward(PING_TARGET_EDIT_PAGE);
        RollerRequest rreq = RollerRequest.getRollerRequest(req);
        try
        {
            BasePageModel pageModel =
                new BasePageModel(getPingTargetEditTitle(), req, res, mapping);
            req.setAttribute("model",pageModel);           
            if (!hasRequiredRights(rreq, rreq.getWebsite()))
            {
                return mapping.findForward(ACCESS_DENIED_PAGE);
            }
            PingTargetData pingTarget = select(rreq);
            ((PingTargetForm) form).copyFrom(pingTarget, req.getLocale());
View Full Code Here

Examples of org.apache.roller.presentation.RollerRequest

    public ActionForward deleteSelected(ActionMapping mapping, ActionForm form,
                                        HttpServletRequest req, HttpServletResponse res)
        throws Exception
    {
        ActionForward forward = mapping.findForward(PING_TARGET_DELETE_PAGE);
        RollerRequest rreq = RollerRequest.getRollerRequest(req);
        try
        {
            BasePageModel pageModel = new BasePageModel(
                    getPingTargetDeleteOKTitle(), req, res, mapping);
            req.setAttribute("model",pageModel);           
            if (!hasRequiredRights(rreq, rreq.getWebsite()))
            {
                return mapping.findForward(ACCESS_DENIED_PAGE);
            }
            PingTargetData pingTarget = select(rreq);
            ((PingTargetForm) form).copyFrom(pingTarget, req.getLocale());
View Full Code Here

Examples of org.apache.roller.presentation.RollerRequest

     */
    public ActionForward deleteConfirmed(ActionMapping mapping, ActionForm form,
                                         HttpServletRequest req, HttpServletResponse res)
        throws Exception
    {
        RollerRequest rreq = RollerRequest.getRollerRequest(req);
        PingTargetForm pingTargetForm = (PingTargetForm) form;
        PingTargetManager pingTargetMgr = RollerFactory.getRoller().getPingTargetManager();
        try
        {
            if (!hasRequiredRights(rreq, rreq.getWebsite()))
            {
                return mapping.findForward(ACCESS_DENIED_PAGE);
            }
            String pingTargetId = pingTargetForm.getId();
            if (pingTargetId == null || pingTargetId.length() == 0)
View Full Code Here

Examples of org.apache.roller.presentation.RollerRequest

                                HttpServletResponse response,
                                Context ctx)
        throws Exception {
       
        Template outty = null;
        RollerRequest rreq = null;
        WebsiteData website = null;
       
        PageContext pageContext =
            JspFactory.getDefaultFactory().getPageContext(
            this, request, response,"", true, 8192, true);

        // first off lets parse the incoming request and validate it
        try {
            rreq = RollerRequest.getRollerRequest(pageContext);
        } catch (Throwable t) {
            // NOTE: indicates real problem, not just a "not found" error
            throw new Exception("ERROR: creating RollerRequest");
        }

        // All pages exist within website, so website MUST be specified
        website = rreq.getWebsite();
        if (website == null) {
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
            return null;
        }
              
        // request appears to be valid, lets render
        try {
            org.apache.roller.pojos.Template page = null;
           
            // If this is a popup request, then deal with it specially
            if(request.getParameter("popup") != null) {
                try {
                    // Does user have a popupcomments page?
                    page = website.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("/popupcomments.vm", website,
                            "Comments", "Comments", "dummy_link",
                            "dummy_template", new Date());
                }
               
                rreq.setPage(page);
               
            // If request specified the page, then go with that
            } else if (rreq.getPage() != null) {
                page = rreq.getPage();
               
            // If page not available from request, then use website's default
            } else {
                page = website.getDefaultPage();
                rreq.setPage(page);
            }
           
            // Still no page ID, then we have a problem
            if ( page == null ) {
                throw new ResourceNotFoundException("Page not found");
View Full Code Here

Examples of org.apache.roller.presentation.RollerRequest

    {
    try
    {
      HttpServletRequest request =
        (HttpServletRequest)pageContext.getRequest();
      RollerRequest rreq = RollerRequest.getRollerRequest(request);
      RollerSession rollerSession = RollerSession.getRollerSession(request);
      if ( rollerSession.isGlobalAdminUser() )
      {
        return super.doEndTag(pw);
      }
View Full Code Here

Examples of org.apache.roller.presentation.RollerRequest

        ResourceBundle.getBundle("ApplicationResources");         

    public SearchResultsPageModel(HttpServletRequest request, boolean wrappers) {
        useWrappers = wrappers;
        try {           
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            setWebsiteSpecificSearch(checkForWebsite(request));
           
            SearchOperation search =
                new SearchOperation(RollerFactory.getRoller().getIndexManager());
            search.setTerm(request.getParameter("q"));
            setTerm(request.getParameter("q"));

            WebsiteData website = null;
            if (isWebsiteSpecificSearch()) {
                website = rreq.getWebsite();
                search.setWebsiteHandle(rreq.getWebsite().getHandle());
            }

            if (StringUtils.isNotEmpty(request.getParameter("c"))) {
                search.setCategory(request.getParameter("c"));
            }
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.