Package org.apache.roller.ui.core

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


    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

        public InvitationsPageModel(HttpServletRequest request,
                HttpServletResponse response, ActionMapping mapping) throws RollerException {
            super("invitations.title", request, response, mapping);
            Roller roller = RollerFactory.getRoller();
            RollerSession rollerSession = RollerSession.getRollerSession(request);
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            WebsiteData website = rreq.getWebsite();
            pendings = roller.getUserManager().getPendingPermissions(website);
        }
View Full Code Here

        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

        ActionForward forward = mapping.findForward("rollerProperties.page");
        try {
            BasePageModel pageModel = new BasePageModel(
                    "configForm.title", request, response, mapping);
            request.setAttribute("model",pageModel);               
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            RollerSession rollerSession = RollerSession.getRollerSession(request);
            if (rollerSession.isGlobalAdminUser() ) {
               
                // just grab our properties map and put it in the request
                Roller mRoller = RollerFactory.getRoller();
View Full Code Here

        mLogger.debug("Handling update request");
       
        ActionForward forward = mapping.findForward("rollerProperties.page");
        ActionErrors errors = new ActionErrors();
        try {
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            RollerSession rollerSession = RollerSession.getRollerSession(request);
            BasePageModel pageModel = new BasePageModel(
                    "configForm.title", request, response, mapping);
            request.setAttribute("model",pageModel);               
            if (rollerSession.isGlobalAdminUser()) {
View Full Code Here

     * @return forward to the ping targets page
     * @throws Exception
     */
    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);
            req.setAttribute("pingTargets", pingTargets);
View Full Code Here

     * @param res
     * @return the result of <code>view()</code> after the target is saved.
     * @throws Exception
     */
    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

     * @return the edit view with the form populated with the ping target specified by the id in the request.
     * @throws Exception
     */
    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());
            return forward;
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.