Package org.apache.roller.ui.core

Examples of org.apache.roller.ui.core.RollerRequest


        ActionForm          actionForm,
        HttpServletRequest  request,
        HttpServletResponse response)
        throws Exception
    {
        RollerRequest rreq = RollerRequest.getRollerRequest(request);
        WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
        WeblogCategoryFormEx form = (WeblogCategoryFormEx)actionForm;
       
        BasePageModel pageModel = null;
        WeblogCategoryData parentCat = null;
        if (null!=rreq.getWeblogCategory() && null==request.getParameter("correct"))
        {
            // If request specifies Category and we are not correcting an
            // already submitted form then load that Category into the form.
            WeblogCategoryData cd = rreq.getWeblogCategory();
            form.copyFrom(cd, request.getLocale());
            request.setAttribute("state","edit");
                            
            parentCat = cd.getParent();           
            pageModel = new BasePageModel(
                "categoryForm.edit.title", request, response, mapping);
            pageModel.setWebsite(cd.getWebsite());
        }
        else if (null != request.getParameter("correct"))
        {
            // We are correcting a previously submtted form.
            // already submitted form then load that Category into the form.
            WeblogCategoryData cd = rreq.getWeblogCategory();
            request.setAttribute("state","correcting");   
           
            parentCat = wmgr.getWeblogCategory(cd.getId());         
            pageModel = new BasePageModel(
                "categoryForm.correct.title", request, response, mapping);
View Full Code Here


    ActionMapping mapping, ActionForm form,
    HttpServletRequest req, HttpServletResponse res)
    throws Exception
  {
        WeblogEntryData entry = null;
        RollerRequest rreq = RollerRequest.getRollerRequest(req);
        RollerSession rollerSession = RollerSession.getRollerSession(req);
        try
        {
            if (rreq.getWebsite() != null
                 && rollerSession.isUserAuthorizedToAuthor(rreq.getWebsite()) )
            {
                String refid = req.getParameter(RequestConstants.REFERRER_ID);
                if ( refid != null )
                {
                    RefererManager refmgr =
                        RollerFactory.getRoller().getRefererManager();                       
                    RefererData ref = refmgr.getReferer(refid);
                    entry = ref.getWeblogEntry();
                    boolean was = ref.getVisible()==null ?
                                  false : ref.getVisible().booleanValue();
                    ref.setVisible(Boolean.valueOf( !was )); // what up, dog?                    
                    refmgr.saveReferer(ref);
                   
                    RollerFactory.getRoller().flush();
                   
                    //PageCacheFilter.removeFromCache( req, rreq.getWebsite() );
                    CacheManager.invalidate(rreq.getWebsite());
                }               
            }
        }
        catch (Exception e)
        {
            mLogger.error("Toggling linkback display",e);
            throw new ServletException(e);
        }
       
        // forward back to entry or to blog if we have no entry
    String url = null;
    try
    {
      RollerContext rctx = RollerContext.getRollerContext();
            if (entry != null) {
                url = entry.getPermalink();
            } else {
          url = rreq.getWebsite().getURL();
            }
            res.sendRedirect(url);
    }
    catch (Exception e)
    {
View Full Code Here

            HttpServletRequest  request,
            HttpServletResponse response)
            throws IOException, ServletException {
       
        try {
            RollerRequest rreq  = RollerRequest.getRollerRequest(request);
            WebsiteData website = rreq.getWebsite();
            RollerSession rses = RollerSession.getRollerSession(request);
           
            if (rses.isUserAuthorizedToAdmin(website) ) {
                IndexManager manager =
                        RollerFactory.getRoller().getIndexManager();
View Full Code Here

            HttpServletRequest  request,
            HttpServletResponse response)
            throws IOException, ServletException {
       
        try {
            RollerRequest rreq  = RollerRequest.getRollerRequest(request);
            WebsiteData website = rreq.getWebsite();
            RollerSession rses = RollerSession.getRollerSession(request);
           
            if ( rses.isUserAuthorizedToAdmin(website) ) {
               
                // some caches are based on weblog last-modified, so update it
View Full Code Here

        ActionForward forward = mapping.findForward("editPages.page");
        WeblogTemplateForm form = (WeblogTemplateForm)actionForm;
        try {
            request.setAttribute("model", new BasePageModel(
                    "pagesForm.title", request, response, mapping));
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            RollerSession rses = RollerSession.getRollerSession(request);
            WebsiteData website = rreq.getWebsite();
            if ( rses.isUserAuthorizedToAdmin(website) ) {
               
                UserManager mgr = RollerFactory.getRoller().getUserManager();
               
                // first off, check if template already exists
View Full Code Here

            HttpServletResponse response)
            throws IOException, ServletException {
       
        ActionForward forward = mapping.findForward("editPage.page");
        try {
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            WeblogTemplate pd = (WeblogTemplate)rreq.getPage();
           
            RollerSession rses = RollerSession.getRollerSession(request);
            if ( rses.isUserAuthorizedToAdmin(pd.getWebsite()) ) {
                BasePageModel pageModel = new BasePageModel(
                        "pageForm.title", request, response, mapping);
View Full Code Here

            throws IOException, ServletException {
       
        ActionForward forward = mapping.findForward("editPages.page");
        try {
            WeblogTemplateForm form = (WeblogTemplateForm)actionForm;
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            RollerSession rses = RollerSession.getRollerSession(request);
            request.setAttribute("model", new BasePageModel(
                    "pagesForm.title", request, response, mapping));
           
            WebsiteData website = rreq.getWebsite();
            if (website == null && form.getId()!=null) {
                UserManager mgr = RollerFactory.getRoller().getUserManager();
                WeblogTemplate template = mgr.getPage(form.getId());
                website = template.getWebsite();
            }
View Full Code Here

            throws IOException, ServletException {
       
        ActionForward forward = mapping.findForward("removePage.page");
        try {
            RollerSession rses = RollerSession.getRollerSession(request);
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            WeblogTemplate page = (WeblogTemplate) rreq.getPage();
            WebsiteData website = page.getWebsite();
            if ( rses.isUserAuthorizedToAdmin(website) ) {
                WeblogTemplateForm form = (WeblogTemplateForm)actionForm;
                form.copyFrom(page, request.getLocale());
               
View Full Code Here

            HttpServletResponse response)
            throws IOException, ServletException {
       
        ActionForward forward = mapping.findForward("editPage.page");
        try {
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            WeblogTemplateForm form = (WeblogTemplateForm)actionForm;
            UserManager mgr = RollerFactory.getRoller().getUserManager();
            WeblogTemplate data = mgr.getPage(form.getId());
            WebsiteData website = data.getWebsite();
           
View Full Code Here

            WebsiteData website,
            WeblogTemplate page)
            throws RollerException {
        UserManager mgr = RollerFactory.getRoller().getUserManager();
        RollerSession rses = RollerSession.getRollerSession(request);
        RollerRequest rreq = RollerRequest.getRollerRequest(request);
       
        UserData user = rses.getAuthenticatedUser();
        request.setAttribute("user", user);
       
        WebsiteData wd = rreq.getWebsite();
        request.setAttribute("website", website);
       
        List pages = mgr.getPages(website);
        request.setAttribute("pages", pages);
       
View Full Code Here

TOP

Related Classes of org.apache.roller.ui.core.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.