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);
        RollerSession rses = RollerSession.getRollerSession(request);
        BookmarkManager bmgr = RollerFactory.getRoller().getBookmarkManager();
        BookmarkFormEx form = (BookmarkFormEx)actionForm;
       
        FolderData parentFolder = null;
        if (null!=rreq.getBookmark() && null==request.getParameter("correct"))
        {
            // If request specifies bookmark and we are not correcting an
            // already submitted form then load that bookmark into the form.
            BookmarkData bd = rreq.getBookmark();
            form.copyFrom(bd, request.getLocale());
            request.setAttribute("state","edit");
               
            // Pass bookmark's Folder on as attribute.                
            parentFolder = bd.getFolder();
            BasePageModel pageModel = new BasePageModel(
                    "bookmarkForm.edit.title", request, response, mapping);
            pageModel.setWebsite(parentFolder.getWebsite());
            request.setAttribute("model", pageModel);
        }
        else if (null != request.getParameter("correct"))
        {
            // We are correcting a previously submtted form.
            request.setAttribute("state","correcting");
               
            // Folder is specified by request param, pass it on as attribute.                
            parentFolder = rreq.getFolder();       
            BasePageModel pageModel = new BasePageModel(
                    "bookmarkForm.correct.title", request, response, mapping);
            pageModel.setWebsite(parentFolder.getWebsite());
            request.setAttribute("model", pageModel);
        }
        else
        {
            // We are adding a new bookmark
            request.setAttribute("state","add");
           
            // Folder is specified by request param, pass it on as attribute.                
            parentFolder = rreq.getFolder();
            BasePageModel pageModel = new BasePageModel(
                    "bookmarkForm.add.title", request, response, mapping);
            pageModel.setWebsite(parentFolder.getWebsite());
            request.setAttribute("model", pageModel);
        }
View Full Code Here


        HttpServletResponse response)
        throws Exception
    {
        ActionForward forward = mapping.findForward("Bookmarks");
        BookmarkFormEx form = (BookmarkFormEx)actionForm;
        RollerRequest rreq = RollerRequest.getRollerRequest(request);
        BookmarkManager bmgr = RollerFactory.getRoller().getBookmarkManager();

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

           
            if (user == null) {
                errors.add(ActionErrors.GLOBAL_ERROR,
                        new ActionError("inviteMember.error.userNotFound"));
            } else {
                RollerRequest rreq = RollerRequest.getRollerRequest(request);
                WebsiteData website = rreq.getWebsite();
                PermissionsData perms = umgr.getPermissions(website, user);
                if (perms != null && perms.isPending()) {
                    errors.add(ActionErrors.GLOBAL_ERROR,
                            new ActionError("inviteMember.error.userAlreadyInvited"));
                    request.setAttribute("model", new BasePageModel(
View Full Code Here

    /*
     * Display the common ping targets with page
     */
    public ActionForward view(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception {
        ActionForward forward = mapping.findForward(PING_SETUP_PAGE);
        RollerRequest rreq = RollerRequest.getRollerRequest(req);
        PingTargetManager pingTargetMgr = RollerFactory.getRoller().getPingTargetManager();
        WebsiteData website = rreq.getWebsite();
        try {
            if (!isAuthorized(rreq, website)) {
                return mapping.findForward("access-denied");
            }

View Full Code Here

    /*
     * Enable a ping target.
     */
    public ActionForward enableSelected(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception {
        RollerRequest rreq = RollerRequest.getRollerRequest(req);
        AutoPingManager autoPingMgr = RollerFactory.getRoller().getAutopingManager();
        PingTargetData pingTarget = select(rreq);
        try {
            if (!isAuthorized(rreq, rreq.getWebsite())) {
                return mapping.findForward("access-denied");
            }
            AutoPingData autoPing = new AutoPingData(null, pingTarget, rreq.getWebsite());
            autoPingMgr.saveAutoPing(autoPing);
            RollerFactory.getRoller().flush();

            return view(mapping, form, req, res);
        } catch (Exception e) {
View Full Code Here

    /*
     * Load delete confirmation view.
     */
    public ActionForward disableSelected(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception {
        RollerRequest rreq = RollerRequest.getRollerRequest(req);
        AutoPingManager autoPingMgr = RollerFactory.getRoller().getAutopingManager();
        PingTargetData pingTarget = select(rreq);
        try {
            if (!isAuthorized(rreq, rreq.getWebsite())) {
                return mapping.findForward("access-denied");
            }
            autoPingMgr.removeAutoPing(pingTarget, rreq.getWebsite());
            RollerFactory.getRoller().flush();

            return view(mapping, form, req, res);
        } catch (Exception e) {
            mLogger.error("ERROR in action", e);
View Full Code Here

    /*
     * Ping the selected target now.
     */
    public ActionForward pingSelectedNow(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception {
        try {
            RollerRequest rreq = RollerRequest.getRollerRequest(req);
            PingTargetData pingTarget = select(rreq);
            WebsiteData website = rreq.getWebsite();
            try {
                if (!isAuthorized(rreq, website)) {
                    return mapping.findForward("access-denied");
                }
                if (PingConfig.getSuspendPingProcessing()) {
View Full Code Here

        HttpServletResponse response)
        throws Exception
    {
        ActionForward forward = mapping.findForward("Bookmarks");
        FolderFormEx form = (FolderFormEx)actionForm;
        RollerRequest rreq = RollerRequest.getRollerRequest(request);
        RollerSession rses = RollerSession.getRollerSession(request);
        BookmarkManager bmgr = RollerFactory.getRoller().getBookmarkManager();
        WebsiteData website = null;
               
        FolderData fd = null;
View Full Code Here

            HttpServletRequest  request,
            HttpServletResponse response)
            throws IOException, ServletException, RollerException {
       
        CommentManagementForm queryForm = (CommentManagementForm)actionForm;
        RollerRequest rreq = RollerRequest.getRollerRequest(request);
        RollerSession rses = RollerSession.getRollerSession(request);
       
        ActionForward fwd = null;
        // Ensure user is authorized to view comments in weblog
        if (rreq.getWebsite() != null && rses.isUserAuthorized(rreq.getWebsite())) {
            fwd =  mapping.findForward("commentManagement.page");
        }
        // Ensure only global admins can see all comments
        else if (rses.isGlobalAdminUser()) {
            fwd =  mapping.findForward("commentManagementGlobal.page");
        }
        else {
            // And everybody else gets...
            return mapping.findForward("access-denied");
        }       
       
        if (rreq.getWeblogEntry() != null) {
            queryForm.setEntryid(rreq.getWeblogEntry().getId());
            queryForm.setWeblog(rreq.getWeblogEntry().getWebsite().getHandle());
        }       
        else if (rreq.getWebsite() != null) {
            queryForm.setWeblog(rreq.getWebsite().getHandle());
        }       
        request.setAttribute("model", new CommentManagementPageModel(
           "commentManagement.title", request, response, mapping, queryForm));
        if (request.getAttribute("commentManagementForm") == null) {
            request.setAttribute("commentManagementForm", actionForm);
View Full Code Here

            ActionForm          actionForm,
            HttpServletRequest  request,
            HttpServletResponse response)
            throws Exception {
        if ("POST".equals(request.getMethod())) {
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            RollerSession rses = RollerSession.getRollerSession(request);
            if (rreq.getWebsite() != null && rses.isUserAuthorized(rreq.getWebsite())
                || rses.isGlobalAdminUser()) {
                WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
                CommentManagementForm queryForm = (CommentManagementForm)actionForm;
                wmgr.removeMatchingComments(
                    rreq.getWebsite(),
                    rreq.getWeblogEntry(),
                    queryForm.getSearchString(),
                    queryForm.getStartDate(request.getLocale())
                    queryForm.getEndDate(request.getLocale()),
                    queryForm.getPending(),
                    queryForm.getApproved(),
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.